htaccess 删除 url 中的重复名称
我有这个页面,如果您滚动到页面中间,您会看到许多链接全部都有重复的名称,例如
http://healingstreamsusa.org/healing/healing/good-grief.html
http://healingstreamsusa.org/healing/healing/forgiveness-not-option.html
,正如您所看到的,有两个治疗/治疗而不是一个治疗/,因此网址全部损坏,并且站点范围内有很多...客户端将所有网址设置为相对网址而不是绝对网址,现在他需要一个htaccess这将删除中间的重复项...这是我所拥有的,它并没有按照我的预期进行重定向...我是否错过了一些东西
RewriteCond %(REQUEST_URI) ^/healing/healing[/]?
RewriteRule (.*) http://healingstreamsusa.org/healing? [R=301,L]
尝试了所有这些...
RewriteRule /about/about/(.+)$ /about/$1 [R=301]
RewriteRule /about/images/(.+)$ /images/$1 [R=301]
RewriteRule /healing/images/stories/(.+)$ /images/stories/$1 [R=301]
RewriteRule /healing/healing/(.+)$ /healing/$1 [R=301]
RewriteRule ^healing/healing/([^/]*)$ /healing/$1
知道为什么这不起作用。 ...
I have this page and if you scroll to the middle of the page you will see many links that all have duplicate names like for example
http://healingstreamsusa.org/healing/healing/good-grief.html
http://healingstreamsusa.org/healing/healing/forgiveness-not-option.html
As you can see there are two healing/healing instead of the one healing/ so the urls are all breaking and there are many sitewide...The client made all the urls relative instead of absolute and now he needs an htaccess that will remove the duplicates in the middle....here is what i have and its doesnt do the redirect as i expected....am i missing something
RewriteCond %(REQUEST_URI) ^/healing/healing[/]?
RewriteRule (.*) http://healingstreamsusa.org/healing? [R=301,L]
Tried all these.....
RewriteRule /about/about/(.+)$ /about/$1 [R=301]
RewriteRule /about/images/(.+)$ /images/$1 [R=301]
RewriteRule /healing/images/stories/(.+)$ /images/stories/$1 [R=301]
RewriteRule /healing/healing/(.+)$ /healing/$1 [R=301]
RewriteRule ^healing/healing/([^/]*)$ /healing/$1
Any idea why this would not work....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)