开发者

.htaccess and Kohana's 2.x project in subdirectory

I have a website on Joomla 1.5 in my base dir - http://example.com - and another project written in开发者_StackOverflow社区 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".


I have added the following:

RewriteRule ^(.*)$ index.php/$1 [PT,L]
RewriteRule ^$ index.php/$1 [PT,L]

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:

  • https://example.com/app/auth
  • https://example.com/app/controller_name/param

However, the following did not work:

  • https://example.com/app

Seems like the index.php hasn't been added when nothing else were passed. Hence the line:

RewriteRule ^$ index.php/$1 [PT,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜