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
-
Phasing in new website - new content on www2
Hi Mozzers, I'm working on a large website redesign / redevelopment project. New sections of the website will be phased in over the next 12 months. The plan is to launch all new content on a subdomain (www2.domain.com) while the old site remains on www.domain.com. There will be no duplicate content across the www and www2 sites, as old content will be removed on www as it is replaced with new content on www2. 301 redirects will also be setup from old content on www to new content on www2. Once the new site on www2 is complete, everything will be moved to www, with a robust 301 redirect setup in place. Is this approach logical, and can you see any SEO implication for managing the migration in this way? Thanks!
Intermediate & Advanced SEO | | RWesley0 -
Should I revive the old domain or just redirect all the juicy links to my new site?
I'm about to acquire a domain with a lot of great/highly authoritative backlinks. The links pointing to the domain are quite powerful and the domain is an exact match TLD. I have two options (that I know of 😞 1. I could redirect all the links to their new home(s) on my new site which offers the same resources the old site used to offer. or 2. I could rebuild the tools/content on this site. Ideally, I'd transfer to my new site as all those powerful links could help all my rankings. However, I'm worried that some of the powerful links will de-link once they see the site redirects elsewhere, even though it's offering the same content. Also, option one isn't an exact match domain. Which, I know, shouldn't make a difference now-a-days but regardless of what people say, it still seems to help out some sites in less competitive niches. One more thing to note: The domain that I'm purchasing is about 25 years old. I'm leaning toward option one. I want to make sure I put my best foot forward on this investment and thought it wise to consult the SEO gods.
Intermediate & Advanced SEO | | ninel_P0 -
An affiliate website uses datafeeds and around 65.000 products are deleted in the new feeds. What are the best practises to do with the product pages? 404 ALL pages, 301 Redirect to the upper catagory?
Note: All product pages are on INDEX FOLLOW. Right now this is happening with the deleted productpages: 1. When a product is removed from the new datafeed the pages stay online and are showing simliar products for 3 months. The productpages are removed from the categorie pages but not from the sitemap! 2. Pages receiving more than 3 hits after the first 3 months keep on existing and also in the sitemaps. These pages are not shown in the categories. 3. Pages from deleted datafeeds that receive 2 hits or less, are getting a 301 redirect to the upper categorie for again 3 months 4. Afther the last 3 months all 301 redirects are getting a customized 404 page with similar products. Any suggestions of Comments about this structure? 🙂 Issues to think about:
Intermediate & Advanced SEO | | Zanox
- The amount of 404 pages Google is warning about in GWT
- Right now all productpages are indexed
- Use as much value as possible in the right way from all pages
- Usability for the visitor Extra info about the near future: Beceause of the duplicate content issue with datafeeds we are going to put all product pages on NOINDEX, FOLLOW and focus only on category and subcategory pages.0 -
Moving Entire Domain to New Site with New File Extensions
I have been looking for a while for a good an clear Step by Step guide for moving a site from an old to a new domain... so I guess a good discussion here, could help many web masters have a smooth transition. So in your opinion, beside the obvious, what are the most important steps you must take? Here is what I do: 1. 301 old site to new one and TEST.
Intermediate & Advanced SEO | | dhidalgo1
2. Check Internal Links - Double Check for 404's.
3. Update your Social Profiles with new URL.
4. Let GWT and BWT of the change and request a Crawl.
5. Contact as Many of Webmaster as you possibly can to point your links to your new domain. What's missing? What have you found helpful and/or Effective?0 -
301 Redirect to a new domain, Need linkbuilding ideas
Hi, I just 301 redirected my 3 year old domain to a new domain which was created yesterday. Now i want to start link building to my new domain. Should i start slowly by publishing 4-5 articles on article directories and a 1 press release a week? Can someone suggest me some ideas on how to handle a new domain. Will be waiting for replies.
Intermediate & Advanced SEO | | Dex3783783780 -
Moving a database from a sub folder to a new domain
Hi Mozzers, I have a very popular property database on a subfolder of my main website. It accounts for about 2 thirds of my overall traffic. I'm moving the database to a new server, so my choices are now a sub domain or completely new domain. If I move my database to a new domain, will my main site lose SEO because of how popular the database is? Cheers Matt
Intermediate & Advanced SEO | | Horizon0 -
Redirecting Powerful Domains
What do you do if you have a client that never implemented a 301 redirect on their domain? For example here are the OSE stats for the URLs; http://url.com PA: 48 DA: 50 LRD: 65 TL: 1,084 FB: 178 FB: 14 T:5 http://www.url.com PA: 51 DA: 50 LRD: 165 TL: 2,271 FB: 178 FB: 14 T:5 G+1:3 My first instincts are to redirect the first one to the second one, but is it too late for that? Will that screw up all of their established stats? Any input or examples of past experiences with this would be great.
Intermediate & Advanced SEO | | MichaelWeisbaum0 -
Domain certificate
Hello, I would like to know if there is any certificate we can buy to increase the Seo of my website. Thanks very much for your time
Intermediate & Advanced SEO | | Cartageno0