• I have 2.6.1 installed and running and everything is good… Every once in a while, I have issues accessing the main page, and excluding the load-balancers, firewalls, etc., I see an odd Location header for the blog.

    The blog is in the (example) location: http://www.somedomain.tld and the physical location is the root area of the webserver directory for this installation… in other words, it not in /blog, etc.

    When I telnet to the webserver and issue the GET command manually, I get the following (example):

    (root):xweb1> telnet 192.168.1.155 80
    Trying 192.168.1.155...
    Connected to 192.168.1.155.
    Escape character is '^]'.
    GET http://www.somedomain.tld HTTP/1.0
    
    HTTP/1.0 301 Moved Permanently
    Date: Wed, 24 Sep 2008 22:41:49 GMT
    Server: Apache
    Vary: Cookie
    X-Pingback: http://www.SomeDomain.tld/xmlrpc.php
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Last-Modified: Wed, 24 Sep 2008 22:41:50 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    Pragma: no-cache
    Location: http://www.SomeDomain.tld//www.somedomain.tld
    Connection: close
    Content-Type: text/html; charset=UTF-8
    
    <!-- Page not cached by WP Super Cache. No closing HTML tag. Check your theme. -->
    Connection to 192.168.1.155 closed by foreign host.
    (root):xweb1>

    Notice the “Location:” header has the host.domain I entered appended at the end of the server name. Most of the time this is not a problem, but I want to eliminate this as an issue.

    Can someone tell me why this is doing that? The web server (Apache) has the index.php as the Index file as well. As you can see, I’m running WP Super Cache as well. Here’s the .htaccess file for reference as well:

    Options FollowSymLinks
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?SomeDomain.tld [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
    </IfModule>
    
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*p=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*p=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{QUERY_STRING} !.*wp-subscription-manager=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>
    
    # END WPSuperCache
    
    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    My browser just sits there like it’s hung up, waiting for a connection to time out. Very odd. No errors in the error log, like it’s in an infinate loop or something, so that why I’m thinking there’s something else going on.

    Thanks in advanced for any help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    What do you have as the two URLs on the Settings->General screen? They should be fully qualified, with a full http and everything.

    If you can’t access the admin section, read this to set those:
    http://codex.wordpress.org/Changing_The_Site_URL

    skinsch, if you view your page in Firefox do you get “Redirect Loop” error?

    Thread Starter skinsch

    (@skinsch)

    iain010100 – I don’t get the “Redirect Loop”.

    Otto42 – In the Settings->General screen, they are both set to the same exact URL, fully qualified and no sub-directories, etc.. i.e. http://www.SomDomain.tld

    I believe I isolated this down to 1 of 2 different internal Proxy servers, so the “hanging” issue may be resolved by that… BUT, the other question is why does the Location bar show the host.domain.tld again?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Well, your answer is that it’s not supposed to do that, so I can’t explain why it does.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Interesting “Location” header redirect’ is closed to new replies.