简体   繁体   English

网址重写不适用于子文件夹

[英]url rewrite not working for a subfolder

I'm trying to change some urls with url rewrite (apache), but nothing works and I just don't understand why. 我正在尝试使用url rewrite(apache)更改一些url,但是没有任何效果,我只是不明白为什么。 This is my .htaccess file: 这是我的.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. 

我通过将文件放在主目录中并关闭规则来解决所有问题(不再需要t01 /)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM