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. Is it good to remove page extensions like ".php" or ".htm" in the end of URL as SEO prospects?

    Is it good to remove page extensions like ".php" or ".htm" in the end of URL as SEO prospects?

    Technical SEO Issues
    8 3 12.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.
    • GovindIRC
      GovindIRC last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • Branagan
        Branagan last edited by

        You can easily change file extensions by making use of mod_rewrite, but you shouldn't make that decision lightly since you would be changing your whole URL structure.

        Bare in mind that urlexample.html, urlexample.php and urlexample are different URLs and you should make a thorough redirection between them, update your links, sitemap, etc.

        If you already have friendly URLs I wouldn't do that change since it wouldn't make a significative improvement and could hurt your rankings, now, if your starting a new site or you need to change your URLs anyway for more important reasons (i.e.: unstructured  bloated, non-descriptive, etc.), then you could go the extra mile since you'd be making your URLs a bit more friendly and a bit shorter, which is probably a good idea.

        Also, you wouldn't have to worry again about redirects in case you need a platform migration (i.e. PHP to ASP).

        Some further reading:

        Google's Wembmaster Guidelines - URL structure

        11 Best Practices for URLs

        Redirection - Best Practices

         

        GovindIRC 1 Reply Last reply Reply Quote 0
        • GovindIRC
          GovindIRC @Branagan last edited by

          This post is deleted!
          BlueprintMarketing Branagan 3 Replies Last reply Reply Quote 0
          • BlueprintMarketing
            BlueprintMarketing @GovindIRC last edited by

            HOLD ON

            can you check your Pagerank with seomoz OSE first?

            you will only hurt your self by not using 301 redirection to the same page without the .php or .htm

            If you're using WordPress use this plugin for fixing the URL's & SEO http://yoast.com/wordpress/seo/

            http://yoast.com/wordpress/seo/#permalink-redirect

            Permalink clean up

            Don’t you hate it when someone adds /2 to the end of a link towards you? Or links with all weird variables (.htm or .php) at the end of the URL? You have a solution now! Just checking one box will redirect all that stuff away, and make sure that your content is always found under the URL you want it to be found under. If you use a Google Custom search engine, checking another box will prevent that from breaking down while using this function.

            To move from a different plugin or framework use this first

            http://wordpress.org/extend/plugins/seo-data-transporter/

            NO

            http://mcamady.blogspot.com/2011/12/hide-php-extension-in-url-using.html

            Hide file extensions in URLs with .htaccess files

            I was working on a (rather neglected, outdated) site I had previously done and decided it needed some (rather, a lot of) improvements. I was looking for a way to get rid of to clean up the <abbr title="Uniform Resource Locater">URL</abbr>s without having to remap my files. .htaccess to the rescue!

            .htaccess files are a wonderful thing, and incredibly powerful, ignoring the bad experience I had with them on my current web host (fortunately, this project is hosted by another web host, and everything runs perfectly with them :)), and Apache's mod_rewrite module does exactly what we need.

            There are a bunch of reasons you'd want to do this, mainly:

            • it looks cleaner and easier to read and remember
            • by using search-engine–friendly <abbr title="Uniform Resource Locator">URL</abbr>s, you're Google PageRank will increase and will increase your website's findability
            • it makes your website environment-independent, so if you ever decide to change the technology your site uses, everything would appear seamless to your visitors.

            In this case, we're using PHP files, but you can change it to whatever type of file you're using, be it.<abbr title="Hypertext Markup Language">html</abbr>, .<abbr title="Active Server Page">asp</abbr>, .<abbr title="ColdFusion">cfm</abbr>, or anything else, as long as they're all the same type. (If you want to do this for multiple file types, just copy lines 2–4 and apply the same technique accordingly.)

            Open your text editor and create a file called ".htaccess" with the following code in it, and upload it to your site's root directory (Note: On Unix and unix-like operating systems, files that start with a dot are hidden files, so you may not be able to see the file after you save it. To get around this, omit the preceding dot when naming the file, and then rename the file back to ".htaccess" after you have uploaded it to your webserver):

             <code>RewriteEngine on
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME}\.php -f
            RewriteRule ^(.*)$ $1.php</code> 
            

            (adapted from the Apache mailing list)

            Using this code, instead of having to type in http://mysite.com/contact.php, you only need to enter http://mysite.com/contact to access that page. And the best part is, you can still access the page with .php on the end of it, so no old incoming links or bookmarks become orphaned as a result of this, and everyone is happy.

            Technorati Tags: web dev, lamp, htaccess, mod_rewrite, server side

            You can really set yourself back if you do not real 301 redirect and you will cause 404 errors in addition to that I don't know what platform you're on however it I know WordPress pretty well so I've given you instructions on how to do this using WordPress. If you are going to do this using another CMS you may want to look this up but it's fairly basic is specially if you're going to rewrite the content on that page or just copy and paste it.

            Simply the reason the server is putting .HTML or.php is based on its language and in many cases people do not bother to hide this however it will help your rankings most of the time 99/100 if you 301 redirect your old link to your new URL that ends with a /

            Here is info for servers like Apache and light speed, some information if you're using Nginx you will need your web host to make these changes.
            I hope this is been of help,
            Thomas

            1 Reply Last reply Reply Quote 0
            • BlueprintMarketing
              BlueprintMarketing @GovindIRC last edited by

              If you have penalties on your target pages and destroyed him or let them stay as a 404 or even worse don't do anything with them. You will not help your case with Google. It is extremely strange that somebody could have a penalty on a page that they control. My advice would be you are lucky as you can remove the offending content.

              If you're trying to say the offending content links to that page and it's not your homepage. That is somewhat different. I would then modified the entire link by deleting it if simply is really penalized. However, everything is case by case I've never seen your website and I'm not telling you to delete your homepage but if you have very low ranking on one site page and the URL is something unique I would remove the URL the bad link is pointing to and rename it. If it is content issues on your website that is causing the penalty obviously you can make the changes yourself.

              1 Reply Last reply Reply Quote 0
              • Branagan
                Branagan @GovindIRC last edited by

                If your site has been indeed penalized and doesn't have much traffic/users, and, since you're taking the time to do this, you might as well consider migrating your content to a new domain name (no re-directions).

                BlueprintMarketing 1 Reply Last reply Reply Quote 0
                • BlueprintMarketing
                  BlueprintMarketing @Branagan last edited by

                  I you agree however you must figure out exactly what prompted you to be penalized. And if Google knows that you have the same content on a different domain they will probably not look the other way because they're getting so much stricter. I don't know that but I wouldn't count on Google being kind. What makes you believe you've been penalized? Have you ever received a notice from Google?

                  GovindIRC 1 Reply Last reply Reply Quote 0
                  • GovindIRC
                    GovindIRC @BlueprintMarketing last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect?
                      Booj
                      Booj
                      0
                      4
                      113

                    • Why these pages are reported as "pages not found"?
                      vivekrathore
                      vivekrathore
                      0
                      4
                      129

                    • "Extremely high number of URLs" warning for robots.txt blocked pages
                      KristinaKledzik
                      KristinaKledzik
                      0
                      8
                      380

                    • "nofollow pages" or "duplicate content"?
                      Matthew_Edgar
                      Matthew_Edgar
                      0
                      2
                      383

                    • Removing .html extension from url? Benefit for SEO?
                      Edgar-Cerecerez
                      Edgar-Cerecerez
                      0
                      8
                      22.2k

                    • Top pages give " page not found"
                      thomasfasting
                      thomasfasting
                      0
                      4
                      511

                    • URL change extension to .php from .htm
                      AndyAtkins
                      AndyAtkins
                      0
                      7
                      1.1k

                    • Does using tags instead of " " good for SEO purposes?
                      RyanKent
                      RyanKent
                      0
                      9
                      9.2k

                    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