| .htaccess How to make a subfolder the main folder for your primary domain |
|---|
|
The primary domain on the hosting account uses the public_html folder for all of its Web site files. Any addon domains use subfolders inside the public_html folder. In order to also set up your primary domain to use a subfolder on your hosting account you will need to set up a redirect in the .htaccess file in the public_html folder so that the server knows that any request for your main domain will be redirected to a subfolder on public_html. Visitors to your Web site will not be able to tell that your primary domain is using a subfolder, they will still see the Web site address as http://www.yourdomain.com/page.html Solution
# Do not change this line. RewriteEngine on # Change yourdomain.com to be your primary domain. RewriteCond %{HTTP_HOST} ^(www.)?yourprimarydomain.com$ # Change 'subfolder' to be the folder you will use for your primary domain. RewriteCond %{REQUEST_URI} !^/subfolder/ # Don't change this line. RewriteCond %{REQUEST_FILENAME} !-f
# Change 'subfolder' to be the folder you will use for your primary domain. RewriteRule ^(.*)$ /subfolder/$1 # Change yourdomain.com to be your primary domain again.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
|