Your hoster’s tech support should help you to make it so your Apache web server will have www.mysite.tld/crm
to be served from www.mysite.tld/crm/public
or /home/username/public_html/crm/public
.
These steps are close to, yet not exactly, what you need.
How to change my document root folder using an .htaccess
file?
By default, your main website is loaded from the public_html folder of your account. The public_html directory is also called web root folder or document root folder. If you would like to keep your site’s files in a subfolder of the public_html
, and do not want the subfolder to appear as a part of the URL to your website, you can mask the subfolder from the URL by placing the following directives in the .htaccess
file inside the public_html
folder:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.tld$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.tld$
RewriteCond %{REQUEST_URI} !folder/
RewriteRule (.*) /folder/$1 [L]
In the above lines you should replace the following:
domain-name.tld – Type your own domain name
folder – Type the name of the subfolder which has the test/development website
If there is no .htaccess file in the public_html folder you can create one using Site Tools > Site >File Manager. Then, type your domain name in a browser and you should see the website which is in your subfolder.