Inside my .htaccess
file, I have the following script:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.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: https://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: http://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.
RewriteCond %{HTTPS} off
isn't this turning HTTPS off then you rewrite to your HTTPS secure server? Wouldn't that create an infinite redirect loop? In Bing and Google webmaster tools have you specified https as your primary domain..htaccess
works. What is the propper way to do 301 redirect?