How do I change the default folder (root) of the domain?

If you need to change the main folder of your domain so that it is not directly as you created it in public_html or if you added it via addon domain and you need a separate folder, you can do it through the .htaccess file located in the root folder of that domain.
If you don't see the .htaccess file there (with a dot), check if it's there by clicking on the "Settings" button in the upper right corner and then it should be checked "show all hidden files and folders", if it is and there is no .htaccess file in the root document, then you can create it by simply clicking on the upper left corner "File" and enter ".htaccess" in the file name (without quotes and with a dot in front).

The code that you need to enter in the .htaccess file itself is the following:

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

Here you need to replace domen.rs with your domain and "folder" with your folder name, after which just save that file.

Scroll to Top