开发者

mod_rewrite works for '/test', but not for '/'

The following code inside an .htaccess file is behaving incorrectly..

RewriteEngine on
RewriteBase /

RewriteCond %开发者_开发技巧{HTTP_HOST} ^(domain\.com)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /test/$1 [L,QSA]

The above will correctly send requests to 'domain.com/uri-here' to the '/test/' directory.. However, requests to 'domain.com/' are not matched / routed.

I'm unsure if there's an issue with the environment, though it seems so due to same / similar code working on another server.

What am I doing wrong?

Thanks in advance!


/ is likely matching against RewriteCond %{REQUEST_FILENAME} !-d

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜