我有一个WordPress网站,一些链接检查器插件报告所有链接以相同的方式被破坏。看看:
http://www.esmedicare.com/category/blog/page/2/locations.html ( parent page: http://www.esmedicare.com/category/blog/page/2/ )
http://www.esmedicare.com/hello-world/locations.html ( parent page: http://www.esmedicare.com/hello-world/ )
http://www.esmedicare.com/neonatal-care-2/locations.html ( parent page: http://www.esmedicare.com/neonatal-care-2/ )
http://www.esmedicare.com/dental-center/locations.html ( parent page: http://www.esmedicare.com/dental-center/
我只是想将所有这些页面重定向到括号中显示的父页面,但我不知道该怎么做。
请帮我解决这个问题。
答案 0 :(得分:2)
尝试在文档根目录中的htaccess文件中添加这些规则,高于任何wordpress规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/locations.html$ /$1/ [L,R=301]