.htaccess从旧文件夹名称重定向到新文件夹名称
我有.htaccess规则,它将一个文件夹名称重写为新名称-.htaccess从旧文件夹名称重定向到新文件夹名称,.htaccess,joomla,.htaccess,Joomla,我有.htaccess规则,它将一个文件夹名称重写为新名称- RewriteEngine on RewriteRule ^home/(.*) profile/$1 urlwww.domian.com/home/abc.html和www.domain.com/profile/abc.html都是根据此规则工作的。如果用户直接在浏览器中键入..home/abc.html,是否有任何方法可以在不更改锚定标记的情况下自动从../home/abc.html重定向到。/profile/abc.html 谢
RewriteEngine on
RewriteRule ^home/(.*) profile/$1
urlwww.domian.com/home/abc.html
和www.domain.com/profile/abc.html
都是根据此规则工作的。如果用户直接在浏览器中键入..home/abc.html
,是否有任何方法可以在不更改锚定标记的情况下自动从../home/abc.html
重定向到。/profile/abc.html
谢谢你的帮助。
谢谢。尝试将规则更改为:
RewriteRule ^home/(.*) profile/$1 [L,R=301]
在规则中添加[L,R=301]
标志可以使请求重定向,而不是在内部重写