My website has document root ~/public_html but i want to add all the files into ~/public_html/www
Is there a way to do this with htaccess?
Thank you.
Locate the addon domain (or subdomain) you wish to modify. Click the pencil icon next to the current document root for the domain you wish to modify. In the pop-up window, enter the new document root and click Change.
To navigate into the root directory, use "cd /" To navigate to your home directory, use "cd" or "cd ~" To navigate up one directory level, use "cd .." To navigate to the previous directory (or back), use "cd -"
htaccess file is a powerful website file that controls high-level configuration of your website. On servers that run Apache (a web server software), the . htaccess file allows you to make changes to your website's configuration without having to edit server configuration files.
add the following lines to the .htaccess file in the public_html 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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With