It's possible that the web server is configured to internally redirect the request based on HTTP request headers that your web browser is sending, but your script isn't. There are several possibilities:
- Your browser is probably using HTTP/1.1, and is thus sending a Host: header.
- Your browser is sending a User-Agent: header. (A likely culprit).
- Your browser is sending an Accept: header. (A less likely culprit).
Try adding these headers to your HTTP request.
Update: The correct answer (HTTP/1.1 + Host:) snuck in while I was typing this.
Update^2: An invaluable reference to have, whether you're using LWP or not, is <a href="http://www.oreilly.com/catalog/webmaster2/"Webmaster in a Nutshell (O'Reilly). It includes a complete overview of HTTP, including request and response headers.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|