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
-
Is an iframe redirect on the same Domain bad for SEO
Good morning. We have a vendor that has created a landing page with content that we want to use. Because of the way we built the site, the only way to use the content is to create an i-frame. The i-frame is re-directingon the same Domain. Would we benefit from the SEO Content?
Intermediate & Advanced SEO | | jdenbo_edf0 -
Redirect Plugin: Redirecting or Rewriting?
Hey everybody! It's been a while since off the boards! I am reworking a site and I have been looking into their Redirection Plugin. I personally tend to lean towards just using the .htaccess because, well, why not. However, when looking deeper into the plugin I found myself a little confused with their redirection wording. RewriteRule ^/products/landing-page-october-2015/$ /products/special-education-news-october-2015/ [R=301,L] Is that the same thing as a classic Redirect 301?
Intermediate & Advanced SEO | | HashtagHustler0 -
After Server Migration - Crawling Gets slow and Dynamic Pages wherein Content changes are not getting Updated
Hello, I have just performed doing server migration 2 days back All's well with traffic moved to new servers But somehow - it seems that w.r.t previous host that on submitting a new article - it was getting indexed in minutes. Now even after submitting page for indexing - its taking bit of time in coming to Search Engines and some pages wherein content is daily updated - despite submitting for indexing - changes are not getting reflected Site name is - http://www.mycarhelpline.com Have checked in robots, meta tags, url structure - all remains well intact. No unknown errors reports through Google webmaster Could someone advise - is it normal - due to name server and ip address change and expect to correct it automatically or am i missing something Kindly advise in . Thanks
Intermediate & Advanced SEO | | Modi0 -
Piggybacking on a domains authority - Unsure on whether to move a sub brand or not
Hey guys, We are a higher ed website and we have a conference centre that would like to have separate brand identity to the college. They have the local keyword friendly domain confrencecentre.ie redirecting to their conference centre landing page on the higher ed site. We are considering going back to the conferencecentre.ie and redirecting the higher ed landing page to this domain. My main concerns are if we do this are we taking a risk with loosing are rankings? Currently we are ranked very highly for many keywords related to conference centre and most of our traffic is from organic. I'm afraid of recommending this move for this reason as I feel the conference centre is piggybacking of the authority of the our higher ed website. I'd love to here your thoughts? Thanks Rob
Intermediate & Advanced SEO | | Griffith0 -
Do you get links from new websites?
There's a new industry specific website that looks decent. It's clean and nothing spammy. However, it's so new it's DA is under 10. Is it worth pursuing a link from a site like this? On one hand, there's nothing spammy and it is industry specific. On the other...it's just DA is so terrible (worse than any of our other links), I don't want it to hurt us. Any thoughts? Ruben
Intermediate & Advanced SEO | | KempRugeLawGroup1 -
Weird Google SERPs after New Domain Transfer 301
Hi, I have some very weird results in the SERPS - We did not do a complete 301 of the entire domain, but rather individual pages. We did the transfer back on 10th of June, and I was checking to see if there were any results on old domain of pages that were transferred to new domain via 301. There were, but... Now I have the following occurring in the search results: Title of Page (Links to old domain!! )
Intermediate & Advanced SEO | | bjs2010
www.oldomain.com › ... › Figures & Sculptures › Tall Sculptures (these last 2 breadcrumbs link to NEW domain??!!)
Bla bla bla (meta description from new domain meta description I know it's Monday, but this one has got me quite concerned! - Any insight appreciated! Am I going nuts?0 -
What are the effects of having Multiple Redirects for pages under the same domain
Dear Mozers, First of all let me wish you all a Very Happy, Prosperous, Healthy, Joyous & Successful New Year ! I'm trying to analyze one of the website's Web Hosting UK Com Ltd. and during this process I've had this question running through my mind. This project has been live since the year 2003 and since then there have be changes made to the website (obviously). There have also been new pages been added, the same way some new pages have even been over-written with changes in the url structures too. Now, coming back to the question, if I've have a particular url structure in the past when the site was debuted and until date the structure has been changes thrice (for example) with a 301 redirect to every back dated structure, WOULD it impact the sites performance SEOwise ? And let's say that there's hundreds of such redirections under the same domain, don't you think that after a period of time we should remove the past pages/urls from the server ? That'd certainly increase the 404 (page not found) errors, but that can be taken care of. How sensible would it be to keep redirecting the bots from one url to the other when they only visit a site for a short stipulated time? To make it simple let me explain it with a real life scenario. Say if I was staying a place A then switched to a different location in another county say B and then to C and so on, and finally got settled at a place G. When I move from one place to another, I place a note of the next destination I'm moving to so that any courier/mail etc. can be delivered to my current whereabouts. In such a case there's a less chance that the courier would travel all the destinations to deliver the package. Similarly, when a bot visits a domain and it finds multiple redirects, don't you think that it'd loose the efficiency in crawling the site? Ofcourse, imo. the redirects are important, BUT it should be there (in htaccess) for only a period of say 3-6 months. Once the search engine bots know about the latest pages, the past pages/redirects should be removed. What are your opinions about this ?
Intermediate & Advanced SEO | | eukmark0 -
Domains merging
Hi everyone, The company I work for has two domains, one for the english version of the website and another one for the french version. Example: www.digitalmusic.com (in english) www.musiquedigitale.com (in french) (these are examples***) I would like to know if on SEO standpoint it would be better to only have one domain so all of the links link to the same domain. Would it increase the domain authority and our rankings ? We will then have: www.digitalmusic.com/fr/page1 for pages in french www.digitalmusic.com/en/page1 for pages in english with all the 301 redirects required... Thank you in advance for your answers.
Intermediate & Advanced SEO | | Maxxum0