Strange HTTP header issue: 301 redirect to the same page?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Strange HTTP header issue: 301 redirect to the same page?

Post by greyhoundcode »

I'm experiencing some confusion regarding the headers returned from a certain URL. The URL in question is:

http://www.mysmartphoneinfo.com/verizon ... rld/399884

The problem is that when I access it (not from a browser, but directly through programming code) the headers returned are:

HTTP/1.1 301 Moved Permanently
Date: Sat, 27 Nov 2010 18:22:52 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
X-Pingback: http://www.mysmartphoneinfo.com/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Last-Modified: Sat, 27 Nov 2010 18:22:52 GMT

Location: http://http/www.mysmartphoneinfo.com/ve ... rld/399884
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8


As you can see, it appears to be issuing a 301 redirect ... to the same page I just requested. Additionally, the formatting of the URL in the location header doesn't seem quite right: "http:/http/www ..." Am I missing something here - what could the reason be for this behaviour? If you follow the link in a browser you seem to arrive at the right page (original URL) without issue.

One theory I have is that, by accessing it programmatically, no browser/agent data is being sent and the website is thus treating the request differently. I'm not, incidentally, doing this with PHP, which is why I have not posted any code.
Post Reply