.htaccess htaccess删除URL中的重复名称
我有这个,如果你滚动到页面的中间,你会看到很多链接都有重复的名字,比如.htaccess htaccess删除URL中的重复名称,.htaccess,mod-rewrite,redirect,.htaccess,Mod Rewrite,Redirect,我有这个,如果你滚动到页面的中间,你会看到很多链接都有重复的名字,比如 http://healingstreamsusa.org/healing/healing/good-grief.html http://healingstreamsusa.org/healing/healing/forgiveness-not-option.html 正如你所看到的,有两个治愈/治愈而不是一个疗愈,所以URL都是断裂的,并且有很多站点……客户端使所有URL相对而不是绝对,现在他需要一个HTTAccess,将
http://healingstreamsusa.org/healing/healing/good-grief.html
http://healingstreamsusa.org/healing/healing/forgiveness-not-option.html
正如你所看到的,有两个治愈/治愈而不是一个疗愈,所以URL都是断裂的,并且有很多站点……客户端使所有URL相对而不是绝对,现在他需要一个HTTAccess,将删除中间的重复……这是我所拥有的,它没有按照我预期的那样重定向……我是吗?遗漏了什么
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
知道为什么这样做不起作用吗?…修复页面,不要添加愚蠢的htaccess规则来执行本来不应该存在的毫无价值的任务。这不是我的要求……客户想要的是……它有很多页面……不仅仅是这一个……他们只是想要快速修复快速修复不是更好的修复。如果他想建立自己的网页,他需要学习如何正确地建立它们。如果可以,按照阿努穆森说的去做!但我贴出了答案@Tamer你必须为每一条创建一条规则!
RewriteEngine On
RewriteRule ^healing/healing/([^/]*)$ healing/$1
RewriteRule ^about/about/([^/]*) about/$1