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. Web Design
    4. Is it bad to have /index.php at the end of a uri?

    Is it bad to have /index.php at the end of a uri?

    Web Design
    7 3 1.9k
    • 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.
    • NoisyLittleMonkey
      NoisyLittleMonkey last edited by

      Is it bad for SEO if traffic is directed to "http://www.example.com/someuri/index.php" instead of "http://www.example.com/someuri/" and would it be works setting up a redirect rule at htaccess level?

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

        It is not "bad", although typical style would be that you can drop it as the extra characters are not needed and nobody likes extra typing - just ask Mr. Twitter.  He used brevity to become a billionaire!  Hmm .. I wish we could get Moz points for alliteration.

        What is key is that you are consistent in your use of it.  If you want to use /index.php then go for it.  Just make sure every time you link to that URL in your menus or in articles when you Twiddle it of Farcebook it, you include the /index.php at the end as you do not want to have duplicate URLs for the same page.  I would also setup 301 redirects so that the / only version redirects to the index.php version.

        All of that said, you are going to find that after the 104th time of Twiddling that URL, you will say, "Gee, it sure is a pain to type all those extra characters."  You will also find that when people are going to share your URLs they may have a tendency to drop the index.php as again, it is extra work.  If you have the redirect in place, you will be ok, but I say, why have you and everyone else do all that extra work to start with.  Just start with the URL ending in the slash and stay with that.  Have all other versions of the index page (index.php, index.htm or even a non slashed version, etc)  301 redirect to the URL that ends in a /.

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

          OK thanks, so index.php won't effect the SEO results. But not redirecting it, as both /index.php and / work correctly and go to the same php file, will result in the same content being registered twice by Google I'm guessing?

          CleverPhD 1 Reply Last reply Reply Quote 0
          • CleverPhD
            CleverPhD @NoisyLittleMonkey last edited by

            Correct - the duplicate issue is what will hurt you.  Whatever you go with, make sure the other variants 301 redirect to the "true" page.

            1 Reply Last reply Reply Quote 0
            • james.rose
              james.rose last edited by

              Whilst I don't think the index.php will have a direct impact on the SEO of your website it could easily have an indirect impact.

              As CleverPhD rightly points out it is a pain in the *** to remember and type that sort of URL.

              Not only for yourself but also for other websites and customers.

              The impact this has is hard to quantify... If I'm a site in your niche and want to link to you does this put me off? What if I link to the wrong site?

              Beyond that ending in index isn't as nice a user experience as just ending at the page name and ultimately its my belief that if you do whats best for the user you'll get good results from google.

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

                Oops thanks for all you answers, but what i should have said is: Is having "/index.php/" half way through the URI like so

                "http://www.example.com/someuri/index.php/more_uri/"

                bad for SEO/UX?

                To clarify if one searched on Google for more_uri and everything else was equal would the index.php in the middle of that URI be damaging to the ranking?

                Sorry about that 🙂

                CleverPhD 1 Reply Last reply Reply Quote 0
                • CleverPhD
                  CleverPhD @NoisyLittleMonkey last edited by

                  Yes bad for both.  You now have the name of a file acting as the name of a folder.

                  As mentioned above - kill the use of index.php as your index "file" - just end in a slash.

                  I know php treats these as routes/queries that then produce a page, but it can get things all messed up real quick.

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post
                  • Disallow: /sr/ and Disallow: /si/ - robots.txt
                    McTaggart
                    McTaggart
                    0
                    3
                    74

                  • When rel canonical tag used, which page does Google considers for ranking and indexing? A/B test scenario!
                    0
                    1
                    45

                  • Privacy Policy: index it/? And where to place it?
                    Chris661
                    Chris661
                    0
                    8
                    1.2k

                  • Traffic flow going through homepage, /default.aspx, and /index.htm - How do I fix this?
                    BD69
                    BD69
                    0
                    5
                    266

                  • Duplicate Page Content mysite.com and mysite.com/index.html MOZ Dashboard
                    bradkrussell
                    bradkrussell
                    0
                    2
                    426

                  • Is it OK to 301 Redirect http://homepage.com to http://blog.homepage.com?
                    SimonCullum
                    SimonCullum
                    0
                    4
                    601

                  • SEOMoz crawl report shows a duplicate content and duplicate title for these two url's http://freightmonster.com/ and http://freightmonster.com/index.html. How do I fix this?
                    Smith-Digital
                    Smith-Digital
                    1
                    3
                    610

                  • How do you get rid of the .html and .php extensions at the end of urls?
                    RyanKent
                    RyanKent
                    0
                    5
                    4.1k

                  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