如何将子目录中的所有页面重定向到一个特定页面
How to redirect all pages in a subdirectory to one particular page
前段时间我用 Wordpress 重做了一个网站。我没有注意到根目录中有一个名为 /dalimduo/ 的子目录,它仍然有页面显示在 Google 搜索结果中。
此子目录的 url 示例:
- http://www.blanchardsystems.com/dalimduo/index.html
- http://www.blanchardsystems.com/dalimduo/about.html
我想将 /dalimduo/ 中的任何页面重定向到此页面:http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/
感谢任何帮助。
尝试:
RedirectMatch 301 ^/dalimduo/ http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/
或者如果您已经在使用 mod_rewrite:
RewriteEngine On
RewriteRule ^dalimduo/ http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/ [L,R=301]
前段时间我用 Wordpress 重做了一个网站。我没有注意到根目录中有一个名为 /dalimduo/ 的子目录,它仍然有页面显示在 Google 搜索结果中。
此子目录的 url 示例:
- http://www.blanchardsystems.com/dalimduo/index.html
- http://www.blanchardsystems.com/dalimduo/about.html
我想将 /dalimduo/ 中的任何页面重定向到此页面:http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/
感谢任何帮助。
尝试:
RedirectMatch 301 ^/dalimduo/ http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/
或者如果您已经在使用 mod_rewrite:
RewriteEngine On
RewriteRule ^dalimduo/ http://www.blanchardsystems.com/event/duo-2015-in-new-orleans/ [L,R=301]