Support » Fixing WordPress » htaccess woes

  • I’ve searched both these forums and the internet at large, but my google-fu (and probably logic) are failing… Nothing seems to relate to my specific issue.

    My wp installation is in a subdirectory, but the site address shown is the main domain – i.e. in General Settings
    Wordpress directory:
    Site address URL:

    Yesterday I made a backup of the htaccess, and tried to make some changes to direct a specific address to another subdirectory of the root. Didn’t work, so gave up and replaced the original htaccess.

    Since then, redirects to and gives a 404 error; the is fine however, as are all the posts.

    The htaccess at the root directory is as follows:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^$ [NC]
    RewriteCond %{REQUEST_URI} !^/public_html/
    RewriteRule ^(.*)$ /public_html/ [L]

    There’s another file at the subdirectory (public_html) that has the wordpress-specific mods:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    Confusingly, both the root on the virtual server AND the subdirectory in which WP is installed are public_html; one is nested in the other. This was done automatically during installation, I think.

    I’ve learned my lesson not to mess around given my ignorance of mod_rewrite rules – I just want to get back to the original setup, so that the static front page will load.

    If I change the Site address URL to the front page loads – but then the address obviously includes the subdirectory, which I want to avoid.

    Any help gratefully received! Thanks.

  • The topic ‘htaccess woes’ is closed to new replies.