Mobile app version of vmapp.org
Login or Join
Dunderdale272

: 301 redirect causing Bingbot to crash, redirection limit reached Inside my .htaccess file, I have the following script: RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}

@Dunderdale272

Posted in: #301Redirect #BingWebmasterTools #Godaddy #Htaccess #WebCrawlers

Inside my .htaccess file, I have the following script:

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ %{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ .php [NC,L]
</IfModule>


Apparently, if I use the Fetch as Bingbot function from Bing Webmaster Tools, and I use HTTP over HTTPS, the redirect does happen, but the message the bingbot returns is:

HTTP/1.1 301 Moved Permanently
Connection: Keep-Alive
Date: Thu, 02 Jan 2014 22:56:55 GMT
Keep-Alive: timeout=5
Content-Length: 235
Content-Type: text/html; charset=iso-8859-1
Location: hsoto.me/index2.php Server: Apache mod_fcgid/2.3.10-dev



<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://hsoto.me/index2.php">here</a>.</p>
</body></html>


And the status message it returns is:

URL: hsoto.me/index2.php Status: Redirection limit reached.


Google Webmaster Tools is just about fine, and my page is even found by typing the address of the website at least. This is not the case on Bing. Any idea why this might be happening?

Additional information:

1-Hosting this domain with Godaddy

2-Website has been up for about 4 days.

Help would be appreciated!

EDIT

function detectIElessThan10(){
if(preg_match('/(?i)msie [2-9]/',$_SERVER['HTTP_USER_AGENT'])){
header("Location:https://www.hsoto.me/nosupport");
}
}


That's the PHP code I'm using to redirect. I also found out that the https URL on Bing does work, but the http doesn't, Bingbot brings the first, the second one, well throws the error previously mentioned.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

Bingbot is not "crashing". The "Fetch as Bingbot" tool within Bing's Webmaster Tools simply does not follow redirects:

From bing webmaster help:


WHAT DOES "REDIRECTION LIMIT REACHED MEAN"?
Unlike the SEO Analyzer tool, Fetch as Bingbot does not follow redirects. Instead it will let you know that the page resulted in a redirect and shows you the HTTP headers it received from your server.


You get the same notice for any redirect. eg. non-www to www redirection, or vice versa.

The actual bingbot that crawls and indexes your website does follow redirects. But you should only be submitting the canonical URL to the search engines anyway. If the canonical URL is example.com then that is the URL you should be submitting, not example.com.
Your htaccess code looks OK, although it could be simplified a bit...

RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule .* %{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ .php [NC,L]


The line RewriteCond %{HTTPS} off simply checks to see whether HTTPS is currently "off" and will only redirect if that condition is met. It does not turn HTTPS off (as is mentioned in comments).


Google Webmaster Tools is just about fine


The "Fetch as Google" tool is actually very similar to Bing's tool. Except that it indicates "Success" (ie. no error state like a 404 etc.). However, if you click on the word "Success" then you are shown the actual response that Googlebot received... which is exactly the same as what you are seeing from the "Fetch as Bingbot" tool. ie. the redirection, not the final page as a result of the redirection. This is the same as what your browser sees, except the browser makes a second request for the redirected page.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme