The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Setting up a 301 redirect from expired webpages

    Setting up a 301 redirect from expired webpages

    Technical SEO Issues
    3 3 1.4k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MatthewBarby
      MatthewBarby last edited by

      Hi Guys,

      We have recently created a new website for one of our clients and replaced their old website on the same domain. One problem that we are having is that all of the old pages are indexed within Google (1000s) and are just getting sent to our custom 404 page. We are finding that there is an large bounce rate from this and also, I am worried from an SEO point of view that the site could lose rank positioning through the number of crawl errors that Google is getting.

      Want I want is to set up a 301 redirect from these pages to go to the 'our brands' page. The reason for this is that the majority of the old URLs linked to individual product pages, and one thing to note is that they are all .asp pages.

      Is there a way of setting up a rule in the htaccess file (or another way) to say that all webpages that end with the suffix of .asp will be 301 redirected to the our brands' page? (there is no .asp pages on the new site as it is all done in php).

      If so, I would love it if someone could post the code snippet. Thanks in advance guys and if you have any other ideas then be my guest to suggest 🙂

      Matt.

      1 Reply Last reply Reply Quote 0
      • timhatton
        timhatton last edited by

        To answer your question directly - yes, there's a rule to put in .htaccess for this.  It would be something like:

        RewriteRule (.*).asp$ http://www.link.to/ourbrandspage (someone who knows regex better may correct me on this)

        However, redirecting everything to the same page is a bit of a waste - if the site has been around for a long time, then there may be inbound links to deep pages in the site which would be better off being redirected to the appropriate page on the new URL structure rather than dumping everyone on the same page.

        If there's a pattern match which you can follow, then you can write regex to cope with this (e.g. if the old structure was http://www.whatever.com/blah.asp and the new one is http://www.whatever.com/blah.php then just do an .htaccess redirect from *.asp to .php - something like RewriteRule  (.).asp $1.php).  However, I'm going to bet it's not that simple.

        Best is to do a proper map of existing links so you can direct the actual old URL to the most relevant URL on the new site.

        I've had to do this kind of "emergency redirect fix" before, for sites with a lot of pages and no neat "pattern match" fix.  The way I usually approach it is to try and get a list of the existing URL structure (either: from a back up version of the site, from Google analytics, from webmaster tools or at a pinch you can scrape the SERPs) to grab all the possible/indexed URLs and stick them in a spreadsheet.  I then prioritise the highest traffic pages - if you can see via Google Analytics (or server logs) which pages get the most inbound traffic, redirect those first to the most appropriate page on the new structure.  That way you can carry on adding new rules into the .htaccess as you go along - you'll probably find of the 1000s of old pages, there's a relatively small %age which get the vast majority of inbound traffic.

        Hope this helps!

        1 Reply Last reply Reply Quote 1
        • Jinx14678
          Jinx14678 last edited by

          Make sure and back up you .htaccess before making any changes...

          Options +FollowSymLinks

          RewriteEngine On
          RewriteRule ^(.*).asp$ $1.php [R=301,L]

          Would convert all asp to php

          but this would only work if you kept your directory structure the same

          Example

          Old Structure http://www.somedomain.com/about.asp

          New Structure http://www.somedomain.com/about.php

          If you did not you will need to do it manually for each page

          Redirect 301 /about.asp http://www.somedomain.com/about-Us.php

          If there are spaces, be sure to use quotes

          Redirect 301 "/about us.asp" http://www.somedomain.com/about-Us.php

          There could be other easier ways, but if I read correctly above, this would be my suggestions

          And of course as TIm suggests above, the proper SEO process would be manually for each page, redirecting to its proper counterpart (if it is indexed, and has links pointing to it or a User Experience page)

          Shane

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • 301 Redirects Showing As 307 Redirects
            0
            1
            64

          • What happens to 301 redirects after the old domain has expired?
            ViviCa1
            ViviCa1
            0
            2
            72

          • Redirect a 301 Redirect
            RedCaffeine
            RedCaffeine
            0
            5
            98

          • 301 redirects reverting to 302 redirects
            Devanur-Rafi
            Devanur-Rafi
            0
            6
            532

          • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
            Chris-CA
            Chris-CA
            0
            5
            456

          • We have set up 301 redirects for pages from an old domain, but they aren't working and we are having duplicate content problems - Can you help?
            cprasad
            cprasad
            0
            12
            2.6k

          • Does it really matter to set 301 redirect for not found error pages?
            alsvik
            alsvik
            0
            4
            431

          • Is it worth setting up 301 redirects from old products to new products?
            indigoclothing
            indigoclothing
            0
            6
            561

          Get started with Moz Pro!

          Unlock the power of advanced SEO tools and data-driven insights.

          Start my free trial
          Products
          • Moz Pro
          • Moz Local
          • Moz API
          • Moz Data
          • STAT
          • Product Updates
          Moz Solutions
          • SMB Solutions
          • Agency Solutions
          • Enterprise Solutions
          • Digital Marketers
          Free SEO Tools
          • Domain Authority Checker
          • Link Explorer
          • Keyword Explorer
          • Competitive Research
          • Brand Authority Checker
          • Local Citation Checker
          • MozBar Extension
          • MozCast
          Resources
          • Blog
          • SEO Learning Center
          • Help Hub
          • Beginner's Guide to SEO
          • How-to Guides
          • Moz Academy
          • API Docs
          About Moz
          • About
          • Team
          • Careers
          • Contact
          Why Moz
          • Case Studies
          • Testimonials
          Get Involved
          • Become an Affiliate
          • MozCon
          • Webinars
          • Practical Marketer Series
          • MozPod
          Connect with us

          Contact the Help team

          Join our newsletter
          Moz logo
          © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
          • Accessibility
          • Terms of Use
          • Privacy