Move to a new domain - How to get the redirects right?
-
Hi,
I hope that someone with good htaccess knowledge can help.
I am planning on moving my site to a new domain. I understand that I should make 301 redirects using htaccess for every URL. This is a big site so it will be impossible to not forget some of the thousands existing URLs.
Now to the question: How do I make all the URLs that is not specified in htaccess to redirect to my new root?
Thanks!
-
Oops, I forgot to update this question after I came to a conclusion. Thanks for answering!
The redirects I ended up with looks like this:
RewriteEngine on
RewriteRule ^old-product.html$ http://www.new-domain.com/new-product.html [R=301]
RewriteRule ^old-category$ http://www.new-domain.se/new-category [R=301]I tried first to write them the way you suggest but it didn't work the way I wanted it do for category pages (or folders).
And I generated an .xml sitemap for the old site first that I used as a list of all URLs to redirect to so I think I covered them all.
-
You don't actually want to do what you're asking - that would mean that no page on your site would 404 (if any missing page redirected to the root).
Better:
Redirect individual pages using:
RedirectPermanent oldpage.html newpage.html
Redirect sections using RedirectMatch or RewriteRule. Then set up a way of tracking 404 errors - either by checking your log files or by doing something like this to track them in google analytics:
http://analytics.blogspot.com/2006/09/tip-tracking-404-pages.html
Then, when you have a list of pages you missed or forgot, you can add redirections for those pages as well.
I hope that makes sense.
-
**** deleted
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Hreflang and canonical tag for new country specific website - different base domain
I have a little different situation compared to most other questions which asks for hreflang and canonical tags for country specific version of websites. This is an SEO related question and I was hoping to get some insight on your recommendations. We have an existing Australian website - say - ausnight.com.au now we want to launch a UK version of this website - the domain is - uknight.co.uk please note, we are not only changing from .com.au to .co.uk.... but the base domain name as well changed - from ausnight to uknight as you can understand, the audience for both websites is different. Both websites has most pages same with same contents.... the questions I have is - Should we put canonical tag on the new website pages? If we don't put canon tag on new website pages, what is the impact on the SEO ranking of current website? I believe we need to put hreflang tag on both websites to tell google that we have another language version (en-au vs en-gb) of the same page. Is this correct?
Intermediate & Advanced SEO | | TinoSharp0 -
Redirecting Domain / Maintaining Keyword Ranking
Right now we have two sites: "our-company.com" and "cool-widgets.com." We rank high for "cool widgets" searches due to our keyword-friendly URL, but we're merging everything into our newly-redesigned company site. Should we redirect the old "cool-widgets.com" homepage to "our-company.com" (to directly transfer the old PR and links), or would it be more prudent to redirect the old homepage to "our-company.com/cool-widgets" to keep the "cool widgets" keyword in the URL? This option seems like it would be good for maintaining organic search results, but it wouldn't pass the strong link backbone to the new site's homepage.
Intermediate & Advanced SEO | | versare0 -
Moving low ranking domain
I have a website, that I rewrote great content for, but I recently found that there are many, many links going to the subdomain that may be pulling it down. Has anyone had experience taking down a site and then moving the content to a new site? Will it be considered duplicate content if you completely take the old site down and use rel="canonical" on new site pages? I don't want to lose the good content, but I cannot have it on the current URL with all the bad backlinking (it's a complicated situation, as I need to keep those backlinks which are affiliates). Thank you.
Intermediate & Advanced SEO | | RoxBrock0 -
Redirect aspx files to a different path structure on a different domain using a different server-side language?
Without getting into the debate/discussion about which server-side language should or should not be used, I am faced with the reality of moving an old ASP.NET site to a Coldfusion one with a different domain and different folder structure. Example: www.thissite.com/animals/lion.aspx --> www.thatsite.com/animals/africa/lion.cfm What is the best way to redirect individual .aspx pages to their .cfm counterparts keeping in mind that, in many cases, the folder paths will be different? If it would mean less work, I am hoping this can be done at the server level (IIS 6) rather than modifying the code on each now-defunct page. And on a related note, how long should any redirects be kept in place? My apologies if this has been answered in this forum in the past, but I did do a lot of searching first (both here and elsewhere) before posting this query.
Intermediate & Advanced SEO | | hamackey0 -
E-commerce Adding New Content - Blog vs New Page
I have an ecommerce site (www.brick-anew.com) focused on Fireplace products and we also have a separate blog (fireplacedecorating.com) focused on fireplace decorating. My ecommerce site needs new content, pages, internal links, etc... for more Google love, attention, and rankings. My question is this: Should I add a blog to the ecommerce site for creating new content or should I just add and create new pages? I have lots of ideas for relevant new content related to fireplaces. Are there any SEO benefits to a blog over new static pages? Thanks! SAM
Intermediate & Advanced SEO | | SammyT0 -
Subdomain or New Domain or Directory path?
Hi Mozzers, I have a dilemma here. I have one of my clients that has its American website and would like to promote its business in canada(2 locations only vs more than 40 in the u.s). What would be the best SEO decision here for the 2 Canadian locations: should i go for a new root domain? if yes why (www.example.ca) a new subdomain? if yes why (ca.example.com) or just following a directory path solution under the american site? (www.example.com/canadiancity) Thanks Ty
Intermediate & Advanced SEO | | Ideas-Money-Art0 -
Multi domain redirect to single domain
Hello, all SEOers. Today, I would like to get some ideas about handling multiple domains. I have a client who bought numerous domains under purpose of prevent abuse of their brand name and at the same time for future uses. This client bought more than 100 domains. Some domains are paused, parked, lived and redirected to other site. I don't worry too much of parked domains and paused domains. However, what I am worrying is that there are about 40 different domains are now redirected to single domain and meta refresh was used for redirections. As far as I know, this can raise red flag for Google. I asked clients to clean up unnecessary domains, yet they want to keep them all. So now I have to figure out how to handle all domains which are redirect to single domain. So far, I came up with following ideas. 1. Build gateway page which shows lists of my client sites and redirect all domains to gateway page. 2. Implement robots.txt file to all different domains 3. Delete the redirects and leave it as parked domains. Could anyone can share other ideas in order to handling current status? Please people, share your ideas for me.
Intermediate & Advanced SEO | | Artience0 -
Brand new domain with a lot of old links.
So I just bought http://penny-auctions.co/ a couple of days ago, ignore the fact it's not set up yet and generally just a mess, and something kept bugging me about why the domain authority kept showing as 25 in the SEOmoz toolbar. Now initially I'd set it up as www. and with the trailing slash so the PA was 1, however after a bit of exploration it seems that someone has been building links to the non-www version of the domain for at least a year! The site has never been owned before so I've now made the non-www version the default and have a 5 day old site with PA 35 and DA 25! SEOmoz shows PA - 45 links, 20 domains and DA - 341 links, 113 domains. Majestic Historic - 8598 links, 236 domains and Fresh - 160 links, 62 domains. Brilliant! Except they're all spamtastic. What do you think this will do for my future attempts at ranking? Should I create pages that have links to them or just 301 them?
Intermediate & Advanced SEO | | StalkerB0