url重写不适用于子文件夹

时间:2012-10-08 14:25:21

标签: apache url-rewriting

我正在尝试使用url rewrite(apache)更改一些网址,但没有任何效果,我只是不明白为什么。这是我的.htaccess文件:

    RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^http://mywebsite.it [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mywebsite.it [NC]
RewriteCond %{HTTP_REFERER} !^http://websiteip [NC]
RewriteRule ^.*$ http://www.mywebsite.it/ [R,L]
ErrorDocument 404 /404.php
RewriteRule ^home$ /t01/index.php [L]
RewriteRule ^chi-siamo$ /t01/chisiamo.php [L]
RewriteRule ^faq$ /t01/faq.php [L]
RewriteRule ^login$ /t01/login_splash.php [L]
RewriteRule ^logout$ /t01/logout.php [L]

There is t01/ in front of the files because I'm trying to see if it works in a subfolder. 

1 个答案:

答案 0 :(得分:1)

我通过将我的文件放在主目录中并清理我的规则(不再是t01 /)来解决所有问题。