Change the directory for my default domain

Asked by:
HubFans / n/a Points
Time:
2018-01-03 12:34 am EST
Category:
Domain Pointing
Hits:
279
Hi,
My public_html directory has got messy. Most of my domains were installed in subdirectories however tabletjury.com was installed directly in the public_html.
I have moved the wordpress install into a public_html/tabletjury.com/ folder. How do I change the domain setup to look in this directory. I have done this for my sub domains but I cannot work out how to do this on the main domain.

Thanks

Ian

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

christopherm
Staff
1,348 Points
2018-01-03 12:47 am EST
Hello Ian,

Thanks for submitting a question about changing the document root for your domain.

The following .htaccess rule will get you the desired result. Place this code into an .htaccess file for your site:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/subdirectory/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subdirectory/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ subdirectory/index.html [L]


Just make sure to substitute example.com with your primary domain and "subdirectory" with the name of the new subdirectory that contains the new site files.

Best,
Christopher M.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}