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. Intermediate & Advanced SEO
    4. Removing index.php

    Removing index.php

    Intermediate & Advanced SEO
    5 4 813
    • 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.
    • MedGroupMedia
      MedGroupMedia last edited by

      I have question for the community and whether or not this is a good or bad idea.

      I currently have a Joomla site that displays www.domain.com/index.php in all the URLs with the exception of the home page.  I have read that it's better to not have index.php showing in the URL at all.  Does it really matter if I have index.php in my URL?  I've read that it is a bad practice.

      I am thinking about installing the sh404SEF component on my site and removing the index.php.  However, I rank pretty high for the keywords I want in Google, Bing and Yahoo.  All of the URLs that show up in the searches have index.php as part of the URL.

      Has anyone ever used sh404SEF to remove the index.php and how did you overcome not loosing your search engine links?  I don't want an existing search showing www.domain.com/index.php/sales and it not linking to the correct page which would now be www.domain.com/sales.  I guess I could insert the proper redirects in the htaccess file.  But I was hoping to avoid having every page of my site in the htaccess file for redirecting.

      Any help or advice appreciated.

      1 Reply Last reply Reply Quote 0
      • Devanur-Rafi
        Devanur-Rafi last edited by

        Hi, any plugin like sh404SEF will work and accomplish your goal without hurting your rankings as long as it redirects, the index.php URLs to their corresponding without index.php URLs via 301. By the way, you don't need to list all your URLs in .htaccess file to implement this. You can go with pattern match redirection.

        Here you go for more:

        http://www.askapache.com/htaccess/301-redirect-with-mod_rewrite-or-redirectmatch.html

        and

        http://www.searchenginepeople.com/blog/htaccess-redirect-rewrite-rules.html

        By the way, having index.php in URLs does not affect your SEO efforts directly but by stripping index.php from all the URLs will make them look pretty, clean and a bit user friendly.

        Hope it helps. Good Luck to you.

        Best regards,

        Devanur Rafi

        <colgroup><col width="182"></colgroup>
        |   |

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

          As Devanur says, this will achieve your goal. It's worth reiterating that there is nothing inherently wrong with /index.php URLs as long as you cannot access the same content without /index.php. For instance, if www.site.com/page1/index.php exists as well as www.site.com/page1/, then this is duplicate content and should be fixed. I imagine this is your current situation because this is most common when /index.php is being added to URLs.

          However, if only one version of every page loads and that version has the /index.php extension, this is not automatically bad. It's preferable for the extension not to be there for the sake of URL tidiness and because this does move the content one folder-level away from the root (not a huge issue, but probably best avoided) however.

          If you go through 301 redirects to shift the old URLs to the new ones without /index.php, your rankings should not suffer. There might be a little bit of ranking fluctuation as Google indexes the new URLs and acknowledges the redirects, but nothing permanent. It's worth noting that this is not an absolute rule, however, and that there is always a risk of lowered rankings or rankings not returning to what they were before after a 301 redirect though.

          Cheers,

          Jane

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

            Devanur/Jane,

            Thank you for the info.

            Dan

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

              Add this to your htaccess file (remove the .txt extension from the file in order to use it)

              Remove index.php or index.htm/html from URL requests

              RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index.(php|html?)\ HTTP/
              RewriteCond %{REQUEST_URI} !^/administrator
              RewriteRule ^([^/]+/)*index.(html?|php)$ http://your_site_URL/$1 [R=301,L]

              Obviously change the your_site_url to the your domain in   http://your_site_URL/$1

              Also remove the # before RewriteEngine On to make these changes work.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • 6 .htaccess Rewrites: Remove index.html, Remove .html, Force non-www, Force Trailing Slash
                roynguyen
                roynguyen
                0
                4
                9.7k

              • Mass Removal Request from Google Index
                KristinaKledzik
                KristinaKledzik
                0
                8
                1.0k

              • Removing pages from index
                tinbum
                tinbum
                0
                4
                112

              • Index or not index Categories
                PinpointDesigns
                PinpointDesigns
                0
                6
                131

              • To remove from index or not and stop words
                Everett
                Everett
                0
                3
                145

              • How to remove an entire subdomain from the Google index with URL removal tool?
                Ocularis
                Ocularis
                0
                3
                7.6k

              • There's a website I'm working with that has a .php extension. All the pages do. What's the best practice to remove the .php extension across all pages?
                digisavvy
                digisavvy
                0
                5
                445

              • Removing pages from index
                AlanBleiweiss
                AlanBleiweiss
                0
                9
                984

              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