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: http://www.example.com/public_html
Site address URL: http://www.example.com
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, http://www.example.com redirects to http://www.example.com/public_html and gives a 404 error; the http://www.example.com/blog is fine however, as are all the posts.
The htaccess at the root directory is as follows:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com$ [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]
</IfModule>
# 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 http://www.example.com/public_html/ the front page loads - but then the address obviously includes the subdirectory, which I want to avoid.
Any help gratefully received! Thanks.