Can I change my root folder from the .htaccess file?

I want to point my domain to a folder different than public_html. How can I do that?

Add Comment
1 Answer(s)
Best answer

The default folder from which you can access application via Internet browser is public_html. However you can have your script installed in a subfolder and you want it to be accessible only by your domain, you should edit the .htaccess file which is located in your public_html folder by adding the following rules:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain$ [NC,OR]
RewriteCond %{HTTP_HOST} ^$
RewriteCond %{REQUEST_URI} !your_application/
RewriteRule (.*) /your_application/$1 [L]You should change „“ with  the name of your domain and „your_application“ with the actual folder in which your application is located.

Once this changes are done you should be able to access your application from:

Danny Walker Answered on October 2, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.