Forum Moderators: phranque

Message Too Old, No Replies

Switching extension from .html to .php

         

pmcshane

7:43 am on Apr 7, 2005 (gmt 0)

10+ Year Member



Hi

I want to switch my site that is all currently dveloped using standard .html pages to one that is php driven. By changing the extension on every page will the search engines still have my site indexed or will I be back to square one as if it were now a new site?

Thanks

specter

7:57 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Changing page extension would result in a deletion from SEs indexes.
Simply because they index a specific url address.
www.mydomain.com/index.html it's not the same that www.mydomain.com/index.php
For SEs it represents completely another page.
So you'll have to restart from the scratch.

topr8

8:30 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



set the server to parse the .html extension with the php engine. that way you can run php scripts from 'html' pages

you should be able to do this in your hosts control panel i would have thought.

grandpa

8:38 am on Apr 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You don't have to lose anything in the SE's.

You can use topr8's suggestion, or you can do a pretty simple rewrite in your .htaccess file (the method I prefer). My php pages get served up looking exactly like their original html counterparts and ranking is not an issue.

I use something like this in my .htaccess file

RewriteRule ^original.html$ http://www.mydomain.com/new.php [L]

That displays the original.html file name in the browser address bar while actually serving up new.php

The Apache forum [webmasterworld.com] would be a great place to learn more about this.

Red_Eye

9:07 am on Apr 7, 2005 (gmt 0)

10+ Year Member



I have change my sites page format several times from html > php and php>asp.net. Each time I simple setup permanant redirects from the old pages to the new. This has seemed to work fine.

tonyedgecombe

9:46 am on Apr 7, 2005 (gmt 0)

10+ Year Member



Just add these lines to your .htaccess file:

RemoveHandler .html
AddType application/x-httpd-php .php .html

all the html will then go through the php parser.

pmcshane

1:09 pm on Apr 7, 2005 (gmt 0)

10+ Year Member



That's great, thanks for the advice, certainly helps alot.