I’m not really sure I understand your question.
The .htaccess
file for WordPress should be in the official
directory where WordPress is installed.
I can see your WordPress permalinks are working already.
What’s the real problem you’re trying to resolve? What’s not working on your site that you’re trying to fix?
Thread Starter
ozrock
(@ozrock)
Thank you George.
I am now ready to use this as the primary site for the domain so need to get the .htaccess to redirect the site when just the dom is entered with the sub dir /official/
At the moment to goes to a static page which linked to a Joomla site which has crashed due to php versions, thus the new site.
David
Thread Starter
ozrock
(@ozrock)
I have used in root this and it seems to work.
Anything I should add, delete?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?lonnielee.com$
RewriteCond %{REQUEST_URI} !^/official/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /official/$1
RewriteCond %{HTTP_HOST} ^(www.)?lonnielee.com$
RewriteRule ^(/)?$ official/index.php [L]
-
This reply was modified 1 month, 2 weeks ago by ozrock. Reason: add code
Subfolders inherit the rules in their parent folder. So as long as the correct directory is being referenced, it should work fine and there’s no need to add/delete anything.
What I don’t know is if any plugin you use that writes to the .htaccess
file will look in the parent directory, or will just create a new file in the WordPress directory.
Personally, I would keep the WordPress rules in the WordPress directory, and have a second .htaccess
file in the root directory with a single rule to redirect /
(or /*
) to /official/
. But this is a mere preference: if your approach works for you, there’s no need to change it.
Good luck!
Now playing: Starlight Starbright 😀
For just $3.99 per month. Advertise your private driveway or parking spot. https://parkingmate.us/monthly-parking-in-sitka-ak/