cakephp 中的 Mod 重定向
我想在 cakephp 中使用 mod_rewrite 。当用户输入域名时,用户应重定向到 http://domain.com/index.html。
I want to use mod_rewrite in cakephp. when user type domain name user should redirect to http://domain.com/index.html.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您的 CakePHP 位置:
如果它运行在 Web 服务器根目录的子目录中(通过 http:// domain.com/cakephp)你可以使用这个:
在默认控制器的默认操作中输入:
否则,如果 CakePHP 从服务器的根目录运行(通过 http://domain.com) 只是 webroot 内的 index.html,您不需要在代码中执行任何操作。
希望这会有所帮助。
That depends on your CakePHP location:
If it runs inside a directory that is a child of the webserver's root directory (accessed as http://domain.com/cakephp) you can just use this:
In the default action of your default controller put this:
Otherwise if CakePHP is running from the root of the server (accessed as http://domain.com) just but index.html inside webroot and you dont need to do anything in code.
Hope that will help.