Hi friends, Can I change my document root folder on server using .htaccess file?
Please help me I need of this urgent.
thanks u all in advance.
How can I change my document root folder
Re: How can I change my document root folder
Yes, you can change my document root folder on server using .htaccess file.
Add the following codes to the .htaccess file in the root folder:
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]
Hope this help you.
Add the following codes to the .htaccess file in the root folder:
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]
Hope this help you.
-
- Posts: 6
- Joined: Thu Jan 22, 2015 4:16 pm
Re: How can I change my document root folder
To change the document root folder:
Log into cPanel.
In the "Domains" section, click the Addon Domains or Sub domains icon, depending on which you'd like to modify.
In the Modify a Domain section at the bottom of the page, click the icon next to the current document root for the domain you wish to modify.
In the popup window, enter the new document root and click Change.
Log into cPanel.
In the "Domains" section, click the Addon Domains or Sub domains icon, depending on which you'd like to modify.
In the Modify a Domain section at the bottom of the page, click the icon next to the current document root for the domain you wish to modify.
In the popup window, enter the new document root and click Change.