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. 301 redirects

    301 redirects

    Technical SEO Issues
    3 2 194
    • 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.
    • nyc-seo
      nyc-seo last edited by

      Hello.

      Our site was recently rebuilt, and we switched from using index.php in all the urls to not using it at all. We also changed the names of many of our pages. So the urls have been renamed from "example.com/index.php/old_page_name/" to "example.com/new-page-name/". While we were at it, we changed from "_" to "-" as our word separators in the urls.

      In the .htaccess file, we have a small block of code that strips out "index.php/" from all requests. This code redirects a request for "example.com/index.php/old_page_name/" to "example.com/old_page_name/"

      For your information, the code that strips out "index.php/" is:

      RewriteCond %{THE_REQUEST} ^GET.index.php [NC]
      RewriteCond %{THE_REQUEST} !/uSZWTLna/.

      RewriteRule (.?)index.php/(.*) /$1$2 [R=301,L]

      Then we have 301 redirects from "example.com/old_page_name/" to "example.com/new-page-name/"

      QUESTION 1: Is this two-step redirect approach okay, or would it be better to skip the separate index.php stripping code and simply have 301 redirects that include "index.php" in the urls?

      QUESTION 2: Will we lose some of the benefit of the links that have to pass through a 301 redirect?

      QUESTION 3: We have 50 or so redirects. Will this affect performance of the site? How many redirects does it take to start affecting performance?

      Thank you!

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

        If you only have 50 or do redirects that you have a list for, I would advise a 1 to 1 redirect. Ie.

        domain.com/index.php/red_widgets/ is changing to domain.com/red-widgets/

        There's no point in redirecting /index.php/red_widgets/ to domain.com/red_widgets/ which you know does not exist.

        It would be wiser to just setup redirects directly from /index.php/red_widgets/ to /red-widgets/ without another step in between. I know that might mean you might not be able to do regular expression, but since you are dealing with 50 redirects only, it's not a big deal.

        Regarding the number of redirects, I won't worry about 50 redirects.

        nyc-seo 1 Reply Last reply Reply Quote 1
        • nyc-seo
          nyc-seo @NakulGoyal last edited by

          Thank you, Nakul!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • 301 Redirects
            industriestaedt
            industriestaedt
            0
            2
            36

          • 301 Redirects
            imoprojects
            imoprojects
            0
            7
            138

          • Should I do a 301 redirect
            lbi-tr
            lbi-tr
            1
            3
            195

          • Where is the 301 redirect?
            JarnoNijzing
            JarnoNijzing
            0
            2
            189

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

          • 301 redirects
            Devin_Anderson
            Devin_Anderson
            0
            2
            366

          • Google Webmaster redirect vs 301 redirect
            lavellester
            lavellester
            0
            2
            493

          • 301 Redirect
            Paul78
            Paul78
            0
            4
            527

          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