.htaccess 和 Kohana 的 2.x 项目位于子目录中
我在我的基本目录中有一个关于 Joomla 1.5 的网站 - http://example.com - 以及另一个用 Kohana 2 编写的项目.x - http://example.com/app。
问题是子目录中的 .htaccess 无法正常工作。
问题:如何配置以及配置哪一个 .htaccess?在子目录中,我的 .htaccess 文件如下所示:
RewriteEngine On
RewriteBase /app/
RewriteRule ^(application|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
当我键入“http://example.com/app”时,子目录中的项目始终尝试转到名为“app”的控制器。
I have a website on Joomla 1.5 in my base dir - http://example.com - and another project written in Kohana 2.x - http://example.com/app.
The problem is that .htaccess in the subdirectory isn't working properly.
Question: How and which one .htaccess to configure? In subdirectory, my .htaccess file looks like this:
RewriteEngine On
RewriteBase /app/
RewriteRule ^(application|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
The project in subdir always tries to go to the controller named "app" when I type "http://example.com/app".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我添加了以下内容:
并且它运行完美!
问题出在托管服务器上。它没有正确处理 PT,需要添加以上行。
一切正常:
但是,以下方法不起作用:
当没有传递任何其他内容时,似乎尚未添加index.php。因此这一行:
I have added the following:
And it is working perfectly!
The problem was with the hosting server. It did not handle the PT correctly and required to add above lines.
Everything worked fine:
However, the following did not work:
Seems like the index.php hasn't been added when nothing else were passed. Hence the line: