繁体   English   中英

htaccess 重写并将 url 从字符 %26 重定向到 &

[英]htaccess rewrite and redirect url from character %26 to &

我有一个以下 URL,它的工作原理如下:

http://www.naturaflowers.com/garland-&-wreaths/garland.html

现在谷歌网站管理员抓取网站并以如下两种格式获取相同的网址并显示重复错误

http://www.naturaflowers.com/garland-&-wreaths/garland.html
http://www.naturaflowers.com/garland-%26-wreaths/garland.html

现在我想将 %26 重定向到 & 字符,这样它就不会在谷歌网站管理员中显示重复项。 请帮助我克服这个问题。 谢谢。

尝试:

RewriteCond %{THE_REQUEST} /garland-%26-wreaths/garland.html
RewriteRule ^(.*)garland-&-wreaths/garland.html$ /$1garland-&-wreaths/garland.html [L,R=301]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM