We do support Round the Clock 24 x 7 x 365 (+91) 883 012 3924
 

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

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

By default, files of your primary website are loaded from public_html folder.

If you want to load website’s files from Sub Folder instead of public_html folder and do not want Sub Folder name to be appeared as a part of the URL of your website then this post is for you 🙂

You need to add below code into /public_html/.htaccess file :

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

// Replace "YourDomain.com" with your actual Domain Name
// Replace "SubFolder" with your Sub Folder name

Please do contact us at esupport@L3webhosting.com if you require any further assistance.

1 Comments

Howdy! This is kind of off topic but I need some advice from an established blog.
Is it tough to set up your own blog? I’m not very techincal but I
can figure things out pretty quick. I’m thinking about setting up my own but I’m not
sure where to start. Do you have any tips or suggestions?
With thanks

Leave a Reply

Your email address will not be published. Required fields are marked *