The main domain on the hosting account uses the public_html folder for all of its website files. In order to also set up your main 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 website will not be able to tell that your main domain is using a subfolder, they will still see the website address as http://www.yourdomain.com/page.html
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line -
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/subfolder/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /subfolder/$1
# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?yourmaindomain.com$
RewriteRule ^(/)?$ subfolder/index.php [L]
Most Popular Articles
How do I perform a trace route?
Traceroute (tracert) works by sending a packet to an open UDP port on a destination machine. For...
How do I get different character sets to display in HTML?
Many web browsers display Western Character Encoding (ISO-8859-1) by default. This means that...
How do I limit what the search engines can index ?
Limiting what search engines can index using /robots.txt Various search engines such as Google...
What is the meaning of owner, group, and everyone in the permissions panel?
- Owner defines the permissions set for your main FTP account. - Group defines permissions valid...
Do I get a Site Seal when I purchase an SSL Certificate?
Yes you do receive a Site Seal when you purchase an SSL Certificate.