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.
0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

1 Comment

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

Leave a comment


Wissam Dandan is an International SEO and Digital Marketing consultant in Daytona Beach, Florida. a Lebanese Origin with a Passion for SEO and Analytics, Founder of LebSEO Design . I also maintain a microblog on Twitter @WissamDandan and Google+

Wissam Dandan
SEO Consultant
Daytona Beach Area

Latest Tweets

Search

Blogroll

css.php