WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] WordPress in sub-folder but won’t appear and seems to auto-redirect to root

[Resolved] WordPress in sub-folder but won’t appear and seems to auto-redirect to root

Viewing 5 replies - 1 through 5 (of 5 total)
  • In the settings page – where it says to type in the address of your blog is it written as:

    http://www.cleanenergy4america.org -or- http://www.cleanenergy4america.org/wordpress

    (it should be the latter)

    Let’s start there.

    It’s definitely the latter. I’ve double checked that. Both the WP address and Blog address are the latter. I even tried making it something different and putting the index.php in a different directory and nothing changed it.

    Don’t know if this helps, but I did a server head test and the response was:

    #1 Server Response: http://www.cleanenergy4america.org/wordpress/
    HTTP Status Code: HTTP/1.1 301
    Date: Tue, 05 Aug 2008 12:35:23 GMT
    Server: ConcentricHost-Ashurbanipal/1.8 (XO(R) Web Site Hosting)
    Location: http://www.cleanenergy4america.org/
    Content-type: text/html;
    Connection: close
    X-Powered-By: PHP/4.4.7
    X-Pingback: http://www.cleanenergy4america.org/wordpress/xmlrpc.php
    Redirect Target: http://www.cleanenergy4america.org/

    So it’s redirecting for some reason, but I don’t know exactly what all of this means.

    davetoliver

    @davetoliver

    Just FYI, for all those who use XO hosting… here’s the fix they gave us:

    In the wp-settings.php file, replace

    // Fix for IIS, which doesn’t set REQUEST_URI
    if ( empty( $_SERVER[‘REQUEST_URI’] ) ) {

    // IIS Mod-Rewrite
    if (isset($_SERVER[‘HTTP_X_ORIGINAL_URL’])) {
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘HTTP_X_ORIGINAL_URL’];
    }
    // IIS Isapi_Rewrite
    else if (isset($_SERVER[‘HTTP_X_REWRITE_URL’])) {
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘HTTP_X_REWRITE_URL’];
    }
    else
    {
    // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    if ( isset($_SERVER[‘PATH_INFO’]) ) {
    if ( $_SERVER[‘PATH_INFO’] == $_SERVER[‘SCRIPT_NAME’] )
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘PATH_INFO’];
    else
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘SCRIPT_NAME’] . $_SERVER[‘PATH_INFO’];
    }

    // Append the query string if it exists and isn’t null
    if (isset($_SERVER[‘QUERY_STRING’]) && !empty($_SERVER[‘QUERY_STRING’])) {
    $_SERVER[‘REQUEST_URI’] .= ‘?’ . $_SERVER[‘QUERY_STRING’];
    }
    }
    }

    // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
    if ( isset($_SERVER[‘SCRIPT_FILENAME’]) && ( strpos($_SERVER[‘SCRIPT_FILENAME’], ‘php.cgi’) == strlen($_SERVER[‘SCRIPT_FILENAME’]) – 7 ) )
    $_SERVER[‘SCRIPT_FILENAME’] = $_SERVER[‘PATH_TRANSLATED’];

    // Fix for Dreamhost and other PHP as CGI hosts
    if (strpos($_SERVER[‘SCRIPT_NAME’], ‘php.cgi’) !== false)
    unset($_SERVER[‘PATH_INFO’]);

    with…

    if(isset($_SERVER[‘QUERY_STRING’]) && !empty($_SERVER[‘QUERY_STRING’])) {
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘PHP_SELF’] . ‘?’ . $_SERVER[‘QUERY_STRING’];
    } else {
    $_SERVER[‘REQUEST_URI’] = $_SERVER[‘PHP_SELF’];
    }

    This helped me to solve a similar issue with the sun java webserver 7 (SAMP environment using the Cool Stack package). Thank you very much guys!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] WordPress in sub-folder but won’t appear and seems to auto-redirect to root’ is closed to new replies.