0
我已经使用mod_rewrite为位于文档根目录中的站点创建更干净的URL。将网站移至子目录时,网址不再有效。我该如何更改模块在子目录的.htaccess中查看文档根目录的位置。使用mod_rewrite重写子目录中的URL
如果可能,我宁愿不在文档根目录或每个重写的add /子目录中创建另一个.htaccess。我试过RewriteBase /sub
,但这似乎没有任何结果。有任何想法吗?
的.htaccess
RewriteEngine On
RewriteRule ^contact$ /contact.html [L]
RewriteRule ^about$ /about.html [L]
RewriteRule ^britishprojects$ /british.html [L]
RewriteRule ^otherprojects$ /european.html [L]
RewriteRule ^video$ /media.html [L]
结构
-/
- /sub
- .htaccess
- index.html etc.