301 redirect to new website
-
We are migrating to a new website that will be using entirely new URLs under the same domain as the old website. The old website is a custom PHP script and the new website uses Drupal.
I know that I should use individual 301 redirects to the corresponding new pages.
My question is just how to set up the hundreds of 301 redirects from the old website to the new one?
Here is the process I've come up with. Please let me know if there is an easier and better way for this.
- Before actually changing to the new website: download an advanced report with all pages on this domain from OSE.
- Find corresponding pages on the new website
- Make the hundreds of 301 redirect lines in an .htaccess file with the following code:
redirect 301 /oldurl.html http://domain.com/the-full-url
Thanks in advance for your help!
-
My preference would always be to use the htaccess file for redirects. There are some situations where the site owner cannot modify their htaccess file due to various restrictions, in which case you would need to use a CMS-based solution or extension.
-
Excellent point, Rebekah. Just how would you do the redirects? In addition to finding out which pages to redirect, I'm particularly interested in the best/fastest technical way to achieve these redirects.
Is it right to do this within the .htaccess file, even if it can become quite large with a few hundred lines of redirects?
-
Thanks for your valuable input, Ryan.
Would you do the redirects with .htaccess file, or would you use another way like a Drupal module. If you would use a module, can you recommend one?
-
I agree Rebekah. Sometimes there are factors outside our control which hinder the optimal SEO solution. In those cases, you can ensure the client is aware of the impact and adjust as you recommended.
-
I agree - in a perfect world redirect all pages. I should have worded my answer more clearly to say "While 301 is a good solution, I don't always recommend it if it is not feasible due to the amount of pages on your site..."
I've worked with a lot of companies who have a lot of red-tape to go through, and really stubborn developers who often refuse to do a lot of "SEO beneficial" work they feel is unnecessary. It's really surprising how much control is in the dev's hands for changes, even coming from upper management, but this is generally a great middle ground for those types of situations.
Thanks for adding that Ryan
-
I agree with most of your plan.
I am not clear if by "advanced report" you are referring to an Open Site Explorer advanced report. If so, I would not recommend that approach. Instead, use a crawler to update your sitemap, then use the sitemap as the most complete list of URLs.
Also, I differ with Rebekah on the point of only redirecting the URLs with the most traffic. When possible I would recommend redirecting every URL to the appropriate page on your new site. Many people might bookmark a page, send an e-mail with a link, etc. You never know who has saved a URL to a page on your site. Also, you did not mention your market. Sometimes a single client is worth thousands of dollars. I would hate to risk losing a potential sale by saving the relatively small amount of time it takes to perform a redirect.
However you choose to proceed there are two additional suggestions. First, ensure your 404 page is friendly and helpful. It should offer your site's navigation, a search box, etc. Second, review your 404 errors DAILY after the site move until your error count drops down to very low numbers.
Good luck.
-
301 redirecting is a good solution, but I don't always recommend redirecting every page. Does every page get a lot of incoming search traffic on its own? I would look at your analytics by landing page and take a look at your top landing pages, and then run an OSE report and see what your top pages there are by amount of links. I would concentrate on redirecting those because they are the most important. You can then do a mod-rewrite to something like a corresponding category for the other pages to make it easier.
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
-
301 redirects for all urls - legal dispute
The website in question is a very high traffic website with substantial credibility in it's subject matter (sorry, can't share more details) that delivers an overwhelming majority of traffic from SEO, much of which is new visitors. A legal dispute has resulted in both parties agreeing to forward a percentage of the total URLs to alternative websites (only 1 website for each party). All URLs for the domain will be forwarded elsewhere. It does not make sense to me that the "sum of the parts" will be as strong once the redirects are implemented but I am looking for feedback. It is fair to say that the alternative domains of each party are no where near as strong as the domain being "parted out." Will the SEO juice be distributed to each domain in full? Will both parties lose out substantially? Feel free to ask for clarifications and I'll do the best I can given the legal parameters. Thanks.
Technical SEO | | ReachMaineAgency0 -
Console: Change Of Address, 301 Redirects Step Not Working
Hi everyone, We just made a switch to a new domain based on a rebrand, and we are currently directing users who navigate to the homepage of the old site to an interim page on our new site that reads companyname.com/companyname, that then redirects to the actual homepage of the new site, companyname.com. The redirect page's purpose is to tell users about the brand name change before showing them the new site. The challenge is that in the second step of the verification process for the address change, it reads that our domain name request does not correspond because the homepage is directing to this interim page. Is there a way for us to continue to direct people to companyname.com/companyname and have GSC verify that the 301 redirects work properly? Ideally we would not want to direct people from the homepage of the old site to the homepage of the new site. Thank you in advance for your help. Sincerely, Chase VHSpF
Technical SEO | | commcreative0 -
Max Number of 301 Redirections?
Hi, We currently made a re-design of a website and we changed all our urls to make them shorter. I made more than 300 permanent redirections but plenty more are needed since WMT is showing some more 404s from old urls that I hadn't seen because they were dynamic. The question is, please, is there a limit? I think we have more than 600 already. We don't want to create a php commando to redirect all the old ones to our home, we are redirecting them to their correspondent url. By the way, Im doing them with the 301 method in .htaccess. Thanks in advance.
Technical SEO | | Tintanus0 -
Which way round to 301 redirect?
Hi We have just added a new layered navigation menu to our website. so for example we had Before : www.tidy-books.co.uk/chidlrens-bookcases (this has the seo juice) And Now: http://www.tidy-books.co.uk/childrens-bookcases-book-storage/childrens-bookcases Might be a stupid question but do I redirect the 'now' url to the 'before' url or the the other way round I look forward to hearing your thoughts Thanks
Technical SEO | | tidybooks0 -
When to 301 a No1 ranking site to the new domain?
I have a site [company.com] that ranks number one for the products of my brand but I'm moving all the efforts to a dedicated brand domain. The old site covered a number of small brands and we had no dedicated brand sites, but we now focus on just this one brand and it doesn't belong on the old company domain name. BRAND belongs on the new brand.com Because of the age of the old company site and because it had the first copy about the brand, it's still ranking well for the brand product names, and the new site has some duplicate content issues that I'm in the throws of resolving. RANKS Company.com : number one for all product names Brand.com : nowhere for product brand names but top for the brand name (as I say, the product pages on this site have duplicate content issues which is likely keeping them ranked low - Hades low. I would rather not maintain two websites and I want to give brand.com every bit of available oomph , so should I at some point 301 the old company site to the new one? If so, is now the time? Thanks
Technical SEO | | Brocberry0 -
Need Help writing 301 redirects in .htaccess file
SEOmoz tool shows me 2 errors for duplicate content pages (www.abc.com and www.abc.com/index.html). I believe, the solution to this is writing 301 redirects I need two 301 redirects 1. abc.com to www.abc.com 2. /index.html to / (which is www.abc.com/index.html to www.abc.com) The code that I currently have is ................................................... RewriteEngine On
Technical SEO | | WebsiteEditor
RewriteCond %{HTTP_HOST} ^abc.com
RewriteRule (.*) http://www.abc.com/$1 [R=301,L] Redirect 301 http://www.abc.com/index.html http://www.abc.com ...................................................... but this does not redirect /index.html to abc.com. What is wrong here? Please help.0 -
Setup 301 Redirects
I have been asked to transfer a clients old domain over to a new domain with a new site. All of the inbound links basically go to the homepage, and the few links that dont go to the homepage on the old site, might as well be redirected to the homepage on the new site. I'm wondering is there a "catch all" sort of redirect such as www.oldsite.com/* redirects to newsite.com. So any redirects we havent set up will automatically go to the new site homepage? And secondly, whats the easiest way to the redirects up? Can I just add it as a parked domain or addon domain in cpanel, and do the redirects in there? Or does it needs its own hosting for the old domain with its own htaccess file? Any help appreciated! 🙂
Technical SEO | | timscullin0 -
How to 301 redirect via OpenCms/7.5.4
Hi everyone, My programmer told me it is impossible to do a permanent redirect from www.website.com/index.html to www.website.com due to cms technical limitation which I do not want to believe hence is it possible / is there documentation available instructing on how to do a proper 301 permanent redirect on OpenCMS 7.5.4? Thanks a lot! Steve
Technical SEO | | sjcbayona-412180