Point domain name to a folder directory with WordPress
I installed my Wordpress site to a subdirectory in my root directory. The reason is that I don't clutter my root directory. So I was looking for ways to point my home site's URL (www.duotales.com) to a subdirectory where WordPress installation of this site is located. I used these steps outlined in this blog and it worked like a charm.
In your public_html folder (also called the “root html” folder), you need to create a file called .htaccess. From this file we are going to use a few lines to redirect those requests in a search engine friendly way.
Add the following lines to that file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain.com$
RewriteRule ^(/)?$ blog [L]
The only change you need to make is to change “YourDomain.com” to your domain. This will then redirect everything from the domain to the folder /blog at that domain. If you want to change that folder just edit the “blog” part.
Also if you are looking how to move a root install in it's own directory, or how to use pre-existing directory to install this WordPress article is useful.
Comments
Post a Comment