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. 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?

    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?

    Intermediate & Advanced SEO
    5 2 445
    • 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.
    • digisavvy
      digisavvy last edited by

      Client wishes to drop the .php extension on all their pages (they've got around 2k pages). I assured them that wasn't necessary. However, in the event that I do end up doing this what's the best practices way (and easiest way) to do this? This is also a WordPress site.

      Thanks.

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

        SEs read .php files so this change probably isn't necessary. If you did, you might establish rewrite rules in .htaccess and add 301 redirects. But again, why mess with the file extensions? Are they having indexation issues?

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

          THey are just seeing sites without them and also would like to not have them.

          That's about it, really. Nothing is broken or having issues being indexed.

          Oversteer 1 Reply Last reply Reply Quote 0
          • Oversteer
            Oversteer @digisavvy last edited by

            If it's for cosmetic reasons then they will likely be causing themselves SEO issues (there is some PageRank leakage with 301 redirects). My suggestion would be to wait until the next site redevelopment and implement extension-less filenames so that the technology doesn't affect the file names in the future. At that time you can implement 301 redirects from the old names with the extensions to the new. It's fairly simple to do in the htaccess file as long as you keep the filename the same (eg /some-filename.php to /some-filename).

            The only valid reason to change at this time is if you are experiencing indexation issues and since that is not the case... 🙂

            digisavvy 1 Reply Last reply Reply Quote 0
            • digisavvy
              digisavvy @Oversteer last edited by

              Awesome! Thanks for clarifying that.

              I'm assuming I'd us a rule similar to below. Is that right/

              RewriteEngine on
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteCond %{REQUEST_FILENAME}\.html -f
              RewriteRule ^(.*)$
              
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • How will changing my website's page content affect SEO?
                WebMarkets
                WebMarkets
                1
                5
                3.4k

              • Pagination and View All Pages Question. We currently don't have a canonical tag pointing to View all as I don't believe it's a good user experience so how best we deal with this.
                PeteC12
                PeteC12
                0
                3
                117

              • Any issue? Redirect 100's of domains into one website's internal pages
                Chris.Menke
                Chris.Menke
                0
                4
                116

              • How to remove my site's pages in search results?
                CleverPhD
                CleverPhD
                0
                7
                108

              • What to do when you buy a Website without it's content which has a few thousand pages indexed?
                BeanstalkIM
                BeanstalkIM
                0
                5
                132

              • What's the best SEO practice for having dynamic content on the same URL?
                Igal_Zeifman
                Igal_Zeifman
                0
                3
                1.3k

              • Best solution to get mass URl's out the SE's index
                James77
                James77
                0
                3
                583

              • Don't want to lose page rank, what's the best way to restructure a url other than a 301 redirect?
                marig
                marig
                0
                6
                1.0k

              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