I have a wordpress subdirectory install in a directory called ‘wordpress’. So currently I am able to access the live site as follows: www.domain.com/wordpress.
My objective is for users to simply navigate to: www.domain.com, omitting the wordpress
directory from the url.
I was wondering if someone can help me configure my .htaccess
so every time a user navigates to anything with domain.com/wordpress
it’ll redirect to domain.com
.
So for example: domain.com/wordpress/admin
will become domain.com/admin
I created a new .htaccess
file and placed in the root with the following contents, which did not work :
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ wordpress [L]
To rewrite / to /wordpress you can use this rule :
This will internally redirect all requests from root to the subfolder.
Do not remove the RewriteCond directive otherwise the the rewrite destination will rewrite back to itself causing an infinite loop error.