我有一个www.site.com
我想将此网站重定向到子目录site.com/folder1/folder2 /
网址仍应仅显示www.site.com。
当他们点击网站时,例如about-us,网址应显示为www.site.com/about-us(但确实是/ folder / 1 / folder2 / about-us)
任何建议都将不胜感激!
答案 0 :(得分:0)
您可以在RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} /folder1/folder2/(\S*)\s [NC]
RewriteRule ^ %1 [R=301,L,NE]
RewriteRule ^((?!folder1/folder2/).*)$ folder1/folder2/$1 [L,NC]
文件中使用此代码:
{{1}}