我再次陷入htaccess! (不是我最强的技能); - )
如何重定向:
www.domain.com/folder1
为:
www.domain.com/folder2/something /
不更改浏览器栏中的网址? (所以继续显示www.domain.com/folder1)
答案 0 :(得分:1)
尝试将此添加到文档根目录中的htaccess文件:
RewriteEngine On
# externally redirect requests made for folder2/something
RewriteCond %{THE_REQUEST} \ /+folder2/something/
RewriteRule ^ /folder1 [L,R=301]
# internally rewrite the request back to /folder2/something/
RewriteRule ^folder1 /folder2/something/ [L]