homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Rewrite all non-www to www version of site, Status 300 not 200.
Is this a problem?
JeffOstroff




msg:4415222
 10:51 pm on Feb 7, 2012 (gmt 0)

We added code to the htaccess to address the canonical Google issue of non-www vs www for the site. The code redirects any example.com to www.example.com on our site.

The code works, and when I run the headers tool to see what the status back from the server is, the report returns with status of 300, when I would expect 200.

I found one definition online that says:

"300 Multiple Choices

The requested resource corresponds to any one of a set of representations, each with its own specific location, and agent- driven negotiation information (section 12) is being provided so that the user (or user agent) can select a preferred representation and redirect its request to that location."


I cannot figure out what they are saying, but I am wondering why it did not return a status of 200 and if Google will have issues with ranking. I know they are particular about not seeing 404 for example, and 302s in the past have been a problem, but what is this 300?

 

JeffOstroff




msg:4415231
 11:35 pm on Feb 7, 2012 (gmt 0)

A little more info, here is the report on the web site when I run the headers tool:

Requesting: http://example.com
GET / HTTP/1.1
Connection: Keep-Alive
Keep-Alive: 300
Accept:*/*
Host: example.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)

Server Response:
HTTP/1.1 301 Moved Permanently Date: Tue, 07 Feb 2012 23:26:09 GMT Server: Apache/1.3.42 (Unix) mod_auth_tkt/2.1.0 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8r Location: http://www.example.com/ Content-Type: text/html; charset=iso-8859-1 X-Pad: avoid browser bug

In the response it shows the 301, but further up above I see the Keep-Alive: 300, am I misinterpreting this to be a status of 300? I'm just wondering why the headers tool does not end with a 200 as the final status.

JeffOstroff




msg:4415235
 12:05 am on Feb 8, 2012 (gmt 0)

Since the above headers tool checker seems to leave out info, I found a better one, and this is what I get below, so I guess all is well. This case is solved!

URL=http://example.com
Result code: 301 (MovedPermanently / Moved Permanently)
Date: Wed, 08 Feb 2012 00:02:22 GMT
Server: Apache/1.3.42 (Unix) mod_auth_tkt/2.1.0 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8r
Location: http://www.example.com/
Content-Type: text/html; charset=iso-8859-1
New location: http://www.example.com/

URL=http://www.example.com/
Result code: 200 (OK / OK)
Date: Wed, 08 Feb 2012 00:02:23 GMT
Server: Apache/1.3.42 (Unix) mod_auth_tkt/2.1.0 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.8r
Last-Modified: Thu, 07 Feb 2008 04:30:23 GMT
ETag: "2c1a378-2b4d-47aa895f"
Accept-Ranges: bytes
Content-Length: 11085
Content-Type: text/html

lucy24




msg:4415249
 1:39 am on Feb 8, 2012 (gmt 0)

further up above I see the Keep-Alive: 300, am I misinterpreting this to be a status of 300?

Yes, it means keep trying for 300 seconds if you have trouble making a connection. Totally unrelated. (Also superfluous, since most browsers will give up after much less time. I clocked one of mine at 75 seconds. Come to think of it, that's probably intentional. The server's time limit is just a fallback.)

In the logs, a with/without www redirect will show up as a 301, just like any other redirect. If the visitor is human it will be instantly followed by a 200 for the desired page.

If you are uneasy, use something like Firefox's Live Headers to see exactly what happens when you put in a request.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved