In my website hosting situation, I have my domain set to a subfolder in public_html, rather than in the root public_html folder. In other words, going to mywebsite.com actually goes to a sub-folder named “mywebsite” in public_html, not directly to public_html.
My main .htaccess (in public_html) needed to be set to:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?mywebsite.com$
RewriteCond %{REQUEST_URI} !^/mywebsite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /mywebsite/$1
RewriteCond %{HTTP_HOST} ^(www.)?mywebsite.com$
RewriteRule ^(/)?$ mywebsite/index.php [L]
Then, inside the /mywebsite/ folder, my .htaccess file was set as per Shane G’s post:
# BEGIN WordPress
<IfModule mod_rewrite.c>
ErrorDocument 404 /index.php?error=404
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Many thanks, O First Result on Google!