Tip: How to run PHP on a .html file

Discussion in 'White Hat SEO' started by snwbrdstylee, Oct 21, 2010.

  1. snwbrdstylee

    snwbrdstylee Registered Member

    Aug 12, 2008
    Likes Received:
    So I recently was required to update my static html website with a ton of new dynamic php based features. My website ranks very well for some highly competitive terms in an extremely cutthroat industry.

    This change could be an SEO nightmare if you just 301 redirect all the pages from .html to the .php versions... no thank you.

    So instead I found this crafty solution.

    How to run PHP with a .html File extension:
    It is quite easy actually!
    Simply insert:
    AddHandler application/x-httpd-php .php .html .htm
    into the top of your .htaccess file and you will now be able to parse PHP within an html file.

    There are a ton of other great SEO uses for this... but you can figure those out for yourself.
    • Thanks Thanks x 2
    Last edited: Oct 22, 2010