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. Local Website Optimization
    4. HTML Page in PHP Website

    HTML Page in PHP Website

    Local Website Optimization
    3 3 430
    • 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.
    • plinggtre67
      plinggtre67 last edited by

      Does having an HTML page in a PHP website affect SEO? I have a PHP website but one of my targeted pages have an HTML page. Will it cause any harm to the website or is it fine to have a html page in a PHP website?

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

        Hi plinggtre67,

        This should have no direct effect on SEO. The reason is, PHP is server sided script, which is usually outputted as HTML anyway. HTML is what the browser actually reads.

        If you are referring to some pages having .html extensions and some having .php, then from user's perspective that may have a slight impact on some users not knowing whats going on, but in general it shouldn't matter. If you would like a consistent look on the page extensions you can use an Apache URL re-write to remove the extensions all together (just like Moz does). You should notice no pages on Moz site have an actual .extension appended to them.

        Example Code: @ StackOverflow

        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME}.php -f
        RewriteRule ^(.)$ $1.phpRewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME}.html -f
        RewriteRule ^(.
        )$ $1.html

        I hope this makes sense and helps,

        Don

        1 Reply Last reply Reply Quote 2
        • GlobeRunner
          GlobeRunner last edited by

          Having different file types in of URLs in your site doesn't affect SEO. It may confuse  you, and you may inadvertently link internally to pages that don't exist on your site, but there is no effect on SEO.

          There is a way to parse HTML files as if they were PHP pages--but nowadays I don't recommend that. If you do have HTML pages on your site, you may just want to leave them alone. But if you do think you need to change or update their functionality, then setting up a 301 Permanent Redirect from the old HTML page to a new .PHP page, for example, will do just fine. It should not have any effect on rankings.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • SERP: From page 4 to page 1 to page 4 again -_- ...
            Everett
            Everett
            0
            2
            58

          • Add Content to Page or Create New Page?
            MiriamEllis
            MiriamEllis
            1
            3
            67

          • More pages on website better for SEO?
            MiriamEllis
            MiriamEllis
            0
            3
            6.1k

          • Top Pages analysis showing wordpress site pages when it was in a subdirectlry
            RyanPurkey
            RyanPurkey
            0
            8
            111

          • Location Pages and Duplicate Content and Doorway Pages, Oh My!
            Dropsolid
            Dropsolid
            0
            10
            3.2k

          • Has anyone had any success buying a local domain website, getting it on first page and then selling it to a local business? I have found some good domains that this might work for but I am wondering if anybody has tried this before.
            KeriMorgret
            KeriMorgret
            2
            9
            1.1k

          • Having portal page that takes you to website with a different url
            Manifestation
            Manifestation
            0
            3
            118

          • How Best to do implement a Branch Locator for a Website with invididual location category pages
            RobertFisher
            RobertFisher
            1
            2
            732

          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