How to change web site document root

You can use following .htaccess rules direct your web site to sub-folder. However, we always recommended having your web site hosted in the public_html folder to avoid any possible issues with cPanel operations.



RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]

In the above lines you should replace the following:

domain-name.com - Type your own domain name
folder - Type the name of the subfolder which has the test/development website

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 cPanel Video Tutorials

Please find 12 cPanel Video Tutorials published by LankaHost. 1.cPanel Video Tutorials -...

 How to Create add-on domain

What are the cPanel add-on domains ?An addon domain allows a new domain name to link to a...

 Getting Started with Your Account

1) Login to the "www.lankahost.net".Then click on the "client area".2) Type your e-mail address...

 How to Upload your website.

 How to create a POP E-MAIL account with cpanel.

1) click the Email Account icon. 2) Fill in the details.(E-mail,password,password again...)...