Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess从旧文件夹名称重定向到新文件夹名称_.htaccess_Joomla - Fatal编程技术网

.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 谢

我有.htaccess规则,它将一个文件夹名称重写为新名称-

RewriteEngine on
RewriteRule ^home/(.*) profile/$1
url
www.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]
标志可以使请求重定向,而不是在内部重写