试图确定在访问页面时,最后一次重定向为什么只返回“太多重定向”错误。如果在最后一个页面之后再添加,那么在访问页面时,它们都会得到相同的错误。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^myhrc.biz$ [OR]
RewriteCond %{HTTP_HOST} ^www.myhrc.biz$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofcontractor.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.houstonroofcontractor.com$ [OR]
RewriteCond %{HTTP_HOST} ^bestroofertx.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.bestroofertx.com$ [OR]
RewriteCond %{HTTP_HOST} ^roofingcompanyhoustontexas.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.roofingcompanyhoustontexas.com$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofingreviews.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.houstonroofingreviews.com$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofingonline.co$ [OR]
RewriteCond %{HTTP_HOST} ^www.houstonroofingonline.co$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofingonline.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.houstonroofingonline.net$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofingonline.info$ [OR]
RewriteCond %{HTTP_HOST} ^www.houstonroofingonline.info$ [OR]
RewriteCond %{HTTP_HOST} ^houstonroofingonline.com$
RewriteRule (.*)$ http://www.houstonroofingonline.com/$1 [R=301,L]
ErrorDocument 404 http://www.houstonroofingonline.com/404.html
RedirectMatch 301 ^/residential http://www.houstonroofingonline.com/residential-roofing-houston.html
RedirectMatch 301 ^/about-us http://www.houstonroofingonline.com/houston-roofing-company.html
RedirectMatch 301 ^/residential/insurance-claims http://www.houstonroofingonline.com/roof-insurance-claims-houston.html
RedirectMatch 301 ^/residential/free-roof http://www.houstonroofingonline.com/free-roof-insurance-claim.html
RedirectMatch 301 ^/residential/storm-damage http://www.houstonroofingonline.com/storm-damage-roof-repair-houston.html
RedirectMatch 301 ^/residential/roof-inspection http://www.houstonroofingonline.com/free-roof-inspection-houston.html
RedirectMatch 301 ^/residential/roof-repair http://www.houstonroofingonline.com/roof-repair-houston.html
RedirectMatch 301 ^/commercial http://www.houstonroofingonline.com/commercial-roofing-houston.html
RedirectMatch 301 ^/contact-us http://www.houstonroofingonline.com/contact.html
RedirectMatch 301 ^/blog http://www.houstonroofingonline.com/houston-roofing-blog.html
RedirectMatch 301 ^/roofing-system-complexities http://www.houstonroofingonline.com/roofing-systems.html
RedirectMatch 301 ^/how-to-select-roof http://www.houstonroofingonline.com/how-to-select-a-roof.html
RedirectMatch 301 ^/your-roof-as-a-selling-tool http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
发布于 2017-12-20 14:42:07
上一次重定向导致重定向循环错误/Too许多重定向错误。让我们看看为什么会发生这样的事情:
RedirectMatch 301 ^/your-roof-as-a-selling-tool http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
实际上,您的RedirectMatch的模式和目标路径是相同的。
Pattern:^/你的房顶销售工具*
目标url:http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
当您请求example.com/your-roof-as-a-selling-tool
时,您的RedirectMatch在第一轮中将url重定向到http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
。在第二轮中,http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
匹配模式并重定向到自己。
为了避免这种多重重定向行为,您需要修复模式,使其与目标路径不匹配。只需在末尾添加regex end of string
字符$,这样它只能匹配特定的uri /your-roof-as-a-selling-tool
而不是...tool.html
。
RedirectMatch 301 ^/your-roof-as-a-selling-tool$ http://www.houstonroofingonline.com/your-roof-as-a-selling-tool.html
https://stackoverflow.com/questions/47893482
复制相似问题