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 Domain Redirect from old domain with HTTPS
My domain was indexed with HTTPS://WWW. now that we redirected it the certificate has been removed and if you try to visit the old site with https it throws an obvious error that this sites not secure and the 301 does not happen. My question is will googles bot have this issue. Right now the domain has been in redirection status to the new domain for a couple months and the old site is still indexed, while the new one is not ranking well for half its terms. If that is not causing the problem can anyone tell me why would the 301 take such a long time. Ive double and quadruple checked the 301's and all settings to ensure its being redirected properly. Yet it still hasn't fully redirected. Something is wrong and my clients ready to ditch the old domain we worked on for a good amount of time. backgorund:About 30 days ago we found some redirect loops .. well not loop but it was redirecting from old domain to the new domain several times without error. I removed the plugins causing the multi redirects and now we have just one redirect from any page on the old domain to the new https version. Any suggestions? This is really frustrating me and I just can't figure it out. My only answer at this point is wait it out because others have had this issue where it takes up to 2 months to redirect the domain. My only issue is that this is the first domain redirect out of many that have ever taken more than a week or three.
Technical SEO | | waqid0 -
Pages with 301 redirects showing as 200 when crawled using RogerBot
Hi guys, I recently did an audit for a client and ran a crawl on the site using RogerBot. We quickly noticed that all but one page was showing as status code 200, but we knew that there were a lot of 301 redirects in place. When our developers checked it, they saw the pages as 301s, as did the Moz toolbar. If page A redirected to page B, our developers and the Moz toolbar saw page A as 301 and page B as 200. However the crawl showed both page A and page B as 200. Does anyone have any idea why the crawl may have been showing the status codes as 200? We've checked and the redirect is definitely in place for the user, but our worry is that there could be an issue with duplicate content if a crawler isn't picking up on the 301 redirect. Thanks!
Technical SEO | | Welford-Media0 -
Several personal websites moving to one domain - 301 or 302?
I feel like I've thought about this so much that now I'm thinking in circles and can't figure this out, so I hope someone can help! We have a group of physicians who currently practice privately, but are going to become one entity with one website. However, they are going to look like sub-entities, if this makes sense - instead of every practice being "One Practice Medical Group" they'll be "Lakeside Primary Care - A One Practice Medical Group Company," and then the other guy will be "Red Mountain Primary Care - A One Practice Medical Group Company" and so on for about a half dozen practices. They all have personal sites already, and many are concerned that they will lose any history for their personal sites and will not rank as well in Google as they do right now. One doctor really wants to keep his own site, and then just have a link on his profile page of the new entity's website. Isn't this counterproductive? Also, if we do redirect all the personal websites to the new entity's domain, it will pass any page rank they already have, correct? Should these be 301 redirects, or 302 redirects? None of the current sites really have a lot of "link juice" but we're working with several strong personalities who want the benefits of the big entity but the autonomy of a private practice.
Technical SEO | | RachelEm0 -
301 redirect relative or absolute path?
Hello everyone, Recently we've changed the URL structure on our website, and of course we had to 301 redirect the old urls to the coresponding new ones. The way the technical guys did this is: "http://www.domain.com/old-url.html" 301 redirect to "/new-url.html"
Technical SEO | | Silviu
meaning as a relative redirect path, not an absolute one like this:
"http://www.domain.com/old-url.html" 301 redirect to "http://www.domain.com/new-url.html" This happened for few thousands urls, and the fact is the organic traffic dropped for those pages after this change. (no other changes were made on these pages and the new urls are as seo friendly as possible, A grade on On-Page Grader). The question is: does the relative redirect negatively affects seo, or it counts the same as an absolute path redirect? Thanks,
S.0 -
I need to know more clearance on rel=canonical usage than 301 redirects ?
Hi all SEOmozs, As we all know purposes of rel=canonical , I have a query to ask that If we don't have any possibility to use 301 redirects on a domain , can it be really right to use rel=canonical on an old domain to let search engine to treat those all pages should be not priority where the domain we are being promoted in the market to list up instead that. I found this interesting Matt Cutts video http://www.youtube.com/watch?v=gJK5Uloy76g where he has told or cleared the point very nicely, yes we can use it if there is no possibility in your older domain or pages. So here i am asking the same to know more detailed clarity on this so that i can be more confidence on it. I have been seeing issues in my domains where old one domain comes than new domain why with new domain contents, and can it be really very good to bring new domain with **rel=canonical without using 301 redirect :
Technical SEO | | Futura
Old : kanin.com (leaving) New : kangarokanin.com (promoting) Where i might have not used yet the rel=canonical in old domain, will be going to use it soon , after finishing this discussion.** Regards,
Teginder Ravi tcSnN.jpg tcSnN.jpg dGd34.jpg0 -
Could a URL change path conflict a 301 redirect?
Hi Mozzers, We create multiple pages for one of my client. Some of them are replacing old pages. I setup 5 of them out of 40. I was able to set them live via the drupal CMS. The new pages were actually published but didn't have any URL but had nodes in directory such as www.example.com/node298. To set them live i changed the url path to one page that already existed( www.example.com/old). In order to setup the replacing page: www.example.com/node298 i added the same name as the old one but in order to avoid URL conflicts with new page(www.example.com/new) I had to change the old page's url path as well such as www.example.com/old2) I know i have to 301 redirect the old to the new obviously but my question is: does a URL path change on the old page www.example.com/old matters in when 301 ing it? will it still transfer all the juice to the new page Visual Process: Main goal: www.example.com/old redirect to www.example.com/new but these two are exactly the same url So modification of URL path: www.example.com/old to www.example.com/old2 to avoid URL conflict Therefore www.example.com/old2 =www.example.com/old (just url change path difference) Question: Because of this url change, will a 301 from www.example.com/old2 to www.example.com/new will still carry all the juice that www.example.com/old carried or not? I hope i didn't make it too confusing. Let me know if it is the case Thanks Mozzers Ty
Technical SEO | | Ideas-Money-Art0 -
301 Redirects
Hello, I have a problem with my website. I have a page on my website http://www.ensorbuilding.com/page.php/aboutus but if i type in www.ensorbuilding.com/page.php/aboutus/f8e45e9d9df6140bb5a7ff1173e8d828 or www.ensorbuilding.com/page.php/aboutus/0f0eea5e9ab0a3e8d91fad8fc0d3ce9c it still displays the about us page. Google is seeing this as duplicate content so what I would want to do is 301 redirect anything after www.ensorbuilding.com/page.php/aboutus . How could I implement a 301 redirect in this way?
Technical SEO | | danielmckay70 -
Wordpress 301 redirects
I use wordpress as CMS on a few sites and I noticed that word press automattically places 301s if I change a url etc. I believe it does it by having the following in the .htaccess file: BEGIN WordPress<ifmodule mod_rewrite.c="">RewriteEngine OnRewriteBase /RewriteRule ^index.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</ifmodule> END WordPress Should I use this? I feel like it limits my control over the 301s.
Technical SEO | | mmaes0