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 - Clearing out a 300 Page WordPress Website (HELP)
I'm working on a WordPress website that has around 300 pages (not posts, pages), many of which have very little content and / or content that is super outdated with zero relevancy. The site has been up and running for 10 years and ranks well overall, 1st in many instances for competitive keywords. The company holds yearly events and works with various other companies who exhibit at their events. In their very early years, they created pages on their website for each of these companies, some of which don't even exist anymore. If I had to delete all of the pages that are deprecated there would only be 10 pages of the site left (with blog posts counted separately). Would it be safe to remove these pages and set a 301 redirect to a semi-related page without hurting the website rankings? Any and all advice appreciated!!
Technical SEO | | enimmo19970 -
Redirect to a new domain and seo effects
I created a one page blogger with listing of several affiliated websites.It gained some visibility on google but it was very plain so i decided to create a wordpress more complex and fancy and to reach the top of search positions. At the moment i decided to keep the listing on blogger and add some links on the page saying "i've moved to a new website. click for more info" and it redirects to my page. But i dont get many clicks to my new site so i was thinking to maybe create a full redirect from my blogger to my wordpress or a iframe to fetch the wordpress but im afraid it may hurt my seo on my blogger. what should i do? thanks in advance
Technical SEO | | cardealpt0 -
Site Penalized - 301 Redirect Question
Hello, We have a website that was penalized roughly two years by Google for "Unnatural Links"... We are experiencing a lot of problems with this site, completely unrelated to the penalty or SERPS, and we're debating doing a 301 Re-direct to another site we own that is totally clean and has no "Unnatural Links". If we do a 301 from the penalized site to our alternative website, will there be any cross-contamination? Will the penalty carry over to our other site? Please let me know what you guys think. Thanks
Technical SEO | | Prime850 -
My Alexa ranking dropped after a 301 redirect is that bad?
I had all of my non www pages redirect to the www versions. My alexa ranking dropped and keeps dropping after I did this. I'm guessing its because its tracking the non www version. Does anyone know if this is correct and should I worry?
Technical SEO | | CandleCam0 -
How do find where a 301 redirect is located
My report says I have http://www.30minuteseder.com/Passover.blog redirected to http://30minuteseder.com/Passover.blog. It is correct, but I can't find where the 301 redirect is located. I looked in my .htaccess file in the root and it's not there. How do I find it so I can change it?
Technical SEO | | Sederman0 -
How can I perform this 301 redirect?
I am working on a site for a colleague and have installed wordpress on their server in the wp directory, they want the root domain redirecting to the wp directory but everything i have tried seems to throw up errors. i need sample.co.uk to redirect to sample.co.uk/wp/ no matter which html file they are trying to access on the root of the sample.co.uk site help?
Technical SEO | | GrassRootsSEO0 -
301 redirect on wordpress.com
Hi, How/where do I input a 301 redirect for my http site within wordpress.com. I am already redirecting my wordpress url to myy new non wordpress domain Thanks Lisa
Technical SEO | | lisamarieCunn0 -
301 Redirect & Cloaking
HEllo~~~~ People. I have a question regarding on cloaking. I will be really greatful if you can help me with question. I have a site www.example.com and it is targeting for multi countries. So I use sub directories for targeting multi countries. e.g. www.example.com/us/ www.example.com/de/ www.example.com/hk/ ....... so on and on. Therefore, when people type www.example.com, I use IP delivery to send users to each coutries. Here is my question. I use 301 redirect for IP delivery, which means when user enter www.example.com, my site read user's IP and send them to right country site by 301 redirect. In this case, is there any possibility that Google considers it as cloaking? Please people.... share me some ideas and thoughs.
Technical SEO | | Artience0