If Page Extensions Changes from .html to .php

Got a question lately where a friend of mine is moving his site from a static HTML website to a .php website. One of his questions where if he needed to add a redirect from his Old URLs to his New URLs, where the the only changing part in his URL structure is the Extension. For Example:

  • Old Url: /wissam-dandan.html
  • New URL: /wissam-dandan.php
Unfortunately, Yes! Google Sees these as 2 different pages and a 301 redirect is needed to preserve the link juice and so it can be transferred (most of it) to the new URL.
Luckily the only variable in this move is the extension which it can resolve with  a 3 line of code in .htaccess to make this a successful move:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php [R=301]
This solution will redirect OLD URLs using a 301 Redirect to new one’s .
On the OTHER Hand, i would approach this problem from a different way, if I was involved from the beginning. what i would do is use the Mod_rewrite and rewrite the URLs so they don’t have any Extensions. This way when your changing CMS platforms or even software used (PHP/ASP/ASPX) all the URLs will be the Same.
Wissam Dandan
Merging English & Arabic search into a global business market. Strong understanding of SEO, Web Analytics & SM strategy. International SEO Consultant.
You may also like
Will 2014 Be the Year Strategy Makes a
Will 2014 Be the Year Strategy Makes a Comeback?
Google Testing New Horizontal Map
1 Comment
  • Santosh Jena Sep 6,2013 at 6:17 pm

    Great information for extension change…
    @Wissam…let me know how can i change in .asp to .aspx?

Leave Your Comment

Your Name*
Your Webpage

Your Comment*

css.phpReal Time Web Analytics