I have a web hosting plan that allows for many parked domains but does not allow for addon domains. Extra cost I don’t need.
So how does one make use of a parked domain.
The intent is to have a number of domains that all point to the same site.
eg maindomain.com.au is my primary site and I have also bought maindomain.net.au and maindomain.com and maindomain.net So I park all of these domains and make my site. So no matter which site you type in you get the same content. Good easy.
Now for complications. I want to have multiple sites on my hosting and park all of the domains on my hosting and have a folder for each site then tell the hosting to show each as if it were the root. Shouldn’t be too hard I hear you say.
Given the long time delay between such projects one tends to forget the intricacies of such swifties. Well this one does anyway. So my darling wife suggested I write it down. But where? I hate having bits of paper floating around and am not quite organised enough to have a file somewhere I can get at it. Good a reason for a blog…
OK so here’s the scenario:
- Webhosting base domain maindomain.com.au
- new domain purchased http://newbiz.com.au/
- Build a nice wordpres site in ./wordpress folder off the root
Now for the messing around:
- Park domain newbiz.com.au
- Set a redirect for this domain to /wordpress/ folder
- create a file in the root of the public file stucture called .htaccess
- insert the following:
options -indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} newbiz.com.au
RewriteCond %{REQUEST_URI} !^wordpress
RewriteRule ^(.*)$ wordpress/$1 [L]
Now go into the wordpress directory and make an .htaccess file and add this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule> # END WordPress
Now in wordpress settings set the site address to crystalcomputertechnology.com.au and leave the wordress address pointing to the directory ie. crystalcomputertechnology.com.au/wordpress
Any further domains have a similar entry in the .htaccess in the root public_html folder and get their own .htaccess in their own folder.