
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
Similar niche store strategies:
Hi Rochelle,
I hope I’m able to save you all that work.
I bit the bullet yesterday and decided to start changing my .info domains over to .coms.
I moved one over last night, and asked the question about redirects to Sonjay on the BANS forum, who told me it was sufficient to just redirect the base URL in the .htaccess file like so
RewriteCond %{HTTP_HOST} ^www.mydomain.info [NC]
RewriteRule (.*) http://www.mydomain.com/$1 [L,R=301]
I tested it using page URL from within the .info site and all worked well.
I hope you’re able to use this and save you some time.
Mick
Mick,
I just tried this and it doesn’t do what I want. It works, but it will take any deep link and send it to the primary URL. I want to send each page from the old site to each page of the new site.
Thanks for trying to save me time, though
Rochelle
So if you’re going to keep some of your sites on your original host, will you also be adding new domains using Hostgator? If so, what will you do differently so than what you did in the past?
I get my names from GoDaddy and then point the DNS to Hostgator. I then just add the new domains in from cpanel, and they all have their own separate urls. I add db’s and build out the site. They sure look and feel like separate domains, but I’m not savvy enough to know for sure!
“I get my names from GoDaddy and then point the DNS to Hostgator. I then just add the new domains in from cpanel, and they all have their own separate urls. I add db’s and build out the site. They sure look and feel like separate domains, but I’m not savvy enough to know for sure!”
Yes, these are separate domains that reside on the same hosting account. That is the only thing these URLs have in common (assuming the sites don’t relate to each other).
“So if you’re going to keep some of your sites on your original host, will you also be adding new domains using Hostgator? If so, what will you do differently so than what you did in the past?”
I think I understand this but am not totally sure. Will you please rephrase this so I can accurately answer you? Sorry for not getting it the first time.
Rochelle
Hi Rochelle,
What I was curious about was how you got into the situation of http://www.siteOne.domain.com in the first place. I’m so clueless about this stuff that I just followed the instructions in the BANS manual and forum when I added new domains that I never realized I was setting up separate domains and not subs. And just by chance or luck or whatever, I’m not having to choose between massive 301 re-directing or massive teeth-pulling.
But I wondered how your domains ended up as sub-domains instead of add-ons. That was all.
Alice
I think she was trying to save some money by not having to register a new domain name, am I right, Rochelle?
Ruthies last blog post..My EPN Earnings Month to Date
Hi Rochelle,
Sorry it didn’t work for you, it worked perfectly for me.
In my browser I keyed in http://www.mydomain.info/Category/Subcat and it redirected me to http://www.mydomain.com/Category/Subcat.
Are your categories and subcategories called the same as on the old site? If not, that would cause it to redirect to the primary URL. Mine are all the same because I’m using the same database.
Cheers
Mick
Alice,
Ruthie is right. I intentionally got myself into the situation of having a site on a subdomain. It was a cost saving action that I will not do again.
As you may have read, Michelle MacPhearson is my mentor right now and I am doing this at her advice. I am working to improve my best performing BANS site, which happened to be on a subdomain. One of the steps I’m taking to make it perform even better is to put it on its own URL. It is something I’ve been considering anyway so Michelle was the fire under my feet for this.
Rochelle
Mick,
I did it!! OMG, this is a fabulous thing!
The code as you gave it to me didn’t work. I played around with it until I got it to work. What did it for me was adding a /$ at the end of my URL. Here is what my code looks like:
RewriteCond %{HTTP_HOST} ^www.mydomain.info/$ [NC]
RewriteRule (.*) http://www.mydomain.com/1 [L,R=301]
Whew! You have no idea how much help this is!!! You are my hero of the week
I’m going to add this to the instructions.
Rochelle
Well, I spoke to soon. The above code DID work, but not consistently. When I checked the links that are indexed at Google I was not taken to the new site.
HOWVER, I did find a method that works. I did this code instead (which I will add to the instructions):
redirect 301 / http://www.you.com/
Change http://www.you.com to your NEW site’s URL.
Rochelle
Hi Rochelle,
Actually, looking at my post again I see that the RewriteRule line has lost a $ symbol, probably because it’s turned into a link. There should be a $ between / and 1 eg. .com/$1 [L,R etc.
Mick
Godaddy coupons bulletin. Almost all of the older Godaddy.com promo codes have just changed. Here’s the new promo codes that are working. These promo codes will be working at Godaddy. $7.49 .com Domains and Manual renewals – Use Go Daddy coupons ZINE10, GOO3, or OK9. 25% discount on orders of $100+ – Use Go Daddy promo code OK25. 30% Discount when you buy any com domain – Use Go Daddy coupon OK30. $12.99 SSL Certificates – Use Godaddy coupon codes GOOSSL, OKSSL, or ZINESSL. Host Plan Promo Code – 20% Off Hosting – Use Go Daddy promo codes OK20H, ZINE20H1 or GOO20H. 10% off any size order – Use Godaddy.com promo codes OK7, GOO1 or ZINE8. $5 Off $30 or More – Use Godaddy.com promo codes GOO2 or ZINE9. 20% Off Any order of $50 or more – Use Go Daddy coupon code OK8.