Client Portal

How to change my document root folder using an .htaccess file? Print

  • 25

Open your .htaccess and add the following:

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

In the above lines you should replace the following:

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


Was this answer helpful?

« Back