Yesterday I wrote about why I no longer use subdomains to create Build A Niche Store (BANS) sites. Today I will explain how to move a niche store from a subdomain to its own domain.
Before I go into how to do this I want to say that I have chosen to do this using two different hosting companies. In another post I will explain why you may want to have multiple hosting companies. Until then, I’ll just say that the niche store I moved was on a subdomain hosted with HostGator and I moved it to a URL hosted with WebHostingPad.
I am going to assume that you know how to purchase a new URL and that you already have a second hosting company (if you don’t I recommend either HostGator or WebHostingPad).
| |
|
How to move a niche store from a subdomain to its own URL
|
|
Step One
|
| |
Log in to the site where you purchased your URL (such as GoDaddy) and direct your new URL (the one your niche store will be transferred to) to your second hosting site. You will be changing the nameservers (sometimes called DNS). You should have the needed information to do this in the ‘Welcome’ email you got from your hosting company. |
| Step Two |
| |
Log in to the hosting account currently hosting niche store’s subdomain (i.e. HostGator). |
| |
|
| |
Follow the instructions found at How to Backup Your Site’s Database to backup your niche store’s database. |
|
Step Three
|
| |
Log in to the hosting account’s cPanel you will move your niche store (i.e. WebHostingPad). |
| |
|
| |
Add your new URL via your Addon Domains link or icon. |
| |
|
| |
Create a database for your new URL. |
| |
Note: It is important you create the new database using the same name as the database used on the subdomain niche store. If the original database was called apples then name the new database apples. |
| |
|
| |
Upload your BANS folders and files to your new ULR complete the installation process to add BANS to the new domain. |
| Step Four |
| |
Log in to the Admin for your niche store located on the subdomain. |
| |
|
| |
Click on the ‘Template‘ tab and take note of the name of the template you are using. |
| Step Five |
| |
Download the template being used at niche store located at the subdomain. Use either an FTP program or your subdomain’s cPanel to download the template being used on the subdomain site. Save the template on your computer. |
| Step Six |
| |
Upload the template to the niche store located at the new URL. Use either an FTP program or your new URL’s cPanel to upload the template to the ‘Themes‘ folder located on the new URL. |
| Step Seven |
| |
Log in to the Admin for the niche store located at the new URL. Click on the ‘Template‘ tab and select the template you uploaded. |
| Step Eight |
| |
Go back to the cPanel for your new URL. Follow the instructions found at How to Restore Your Database From cPanel. As stated in step three, it is important that the database you restore has the same name as the one you created. |
| |
Note: You may need to change the settings for the ‘Security‘ tab located in the Admin of your niche store after restoring the database. It will restore the settings to whatever you used at the subdomain location. Be aware that your login details will be the same as they were at the previous location. |
|
.
|
Check your new URL. Your niche store should look exactly the same as the niche store located at the subdomain.
If you don’t have a second hosting company you can still move your subdomain to a new URL but the database aspect of this will make doing this on the same hosting company as your subdomain a bit challenging. I haven’t done this but I think it would be a matter of backing up the database, deleting the current database, creating a new database with the same name/username as the deleted database, then associating the new database with the new URL. After it has been associated you will need to restore the database. The main problem I see with this method is that you risk having downtime on your subdomain before the niche store at the new URL is ready for viewing.
Ok, the easy part is now done. Next comes the really fun part of transferring a site. You get to create redirects for every single page on your site! You can do this by following the instructions found at How to Redirect Deleted or Renamed URLs to New Pages with a 301 Redirect. When you follow these instructions you will create the 301 redirects on the .htaccess for the store located at the subdomain, NOT the new URL.
06/21/2008 edit: Mick and Sanjay have saved the day/week/month/year by sharing how to easily modify the .htaccess file to redirect an entire site to its new location by adding one bit of code. By adding these two lines of code you will be able to redirect your entire site. This means any link from your old site will send visitors to that exact page within your new site. In other words, you won’t have to create a redirect for every page.
I couldn’t get the code Mick shared to work but found a slight modification that did work for me. I will include both versions here in the event that one doesn’t work for you but the other does.
First, open your old site’s .htaccess file (this is from the site you are moving away from, NOT your new site) and save a copy of this file.
Place either of the following codes directly UNDER RewriteEngine On:
Mick’s Code:
RewriteCond %{HTTP_HOST} ^www.mydomain.info [NC]
RewriteRule (.*) http://www.mydomain.com/1 [L,R=301]
My Code:
RewriteCond %{HTTP_HOST} ^www.mydomain.info/$ [NC]
RewriteRule (.*) http://www.mydomain.com/1 [L,R=301]
Change www.mydomain.info to your OLD site’s URL. Change http://www.mydomain.com/1 to your NEW site’s URL.
Save changes and click a link on your old site to see if you are taken to your new site. If one of these codes doesn’t work then try the other.
06/21/2008 Edit #2: After writing the above I found that the code I added worked but not consistently. I searched and found an even easier code that you can add to your .htaccess. If neither of the above works for you then try this code:
redirect 301 / http://www.you.com/
Change www.mydomain.com to your NEW site’s URL.
I strongly recommend you check that any of the above methods works by going to a search engine, such as Google, and entering site:mydomain.com (use your URL, both with and without www) and clicking any link to see where you are taken. If you go to the original location, NOT the new location, then try one of the other two codes.
Creating 301 redirects might not be fun, but it is necessary. If your niche store has backlinks pointing to it or your site was indexed in search engines then the pages that are indexed will take people to the subdomain location. You want to send people to your store’s new location, not the old one. The 301 redirect will make sure people end up at the right place.
Also, if you added any mods to your site while it was located at the subdomain, such as the How to Add ‘Bookmark This Site’ Code To Your Site, then you will need to update the links to your new URL. You might want to go through the header and footer for your template to make sure you get all the links. Did you add any links to your footer, perhaps for your sitemap or privacy policy? If so, update them.
Lastly, if you added your site to Google’s WebMaster Tools then you may will want to update your site information there, including your store’s sitemap location.
Well, that’s it. Phew! I’m off to create a huge list of redirects for my transferred site. I should be done in a week or two
Rochelle