Page 1 of 1

Move to php: Naming files, search engines, and indexing

Posted: Mon Aug 29, 2005 11:33 am
by zman
I'm updating my online store with some php.

Since php is so prevalent now.. why not give all html pages ".php" extensions (even if they don't contain php) so that when they are indexed by robots you won't have a problem renaming files and ruining "index paths".

The problem I have now is, all my pages are indexed by google as ".html" and they will soon all be ".php". I can do a re-direct to the new .php pages, but again, why not just name them php to begin with? Even non-php html files.

Just wondering....

Posted: Mon Aug 29, 2005 11:36 am
by feyd
performance reasons, most often. PHP still has to load the file, analyze for code it should execute and then spit out the file. You may also have issues if php has it's default content-type output switched from text/html to say text/plain

Posted: Mon Aug 29, 2005 11:47 am
by zman
feyd wrote:performance reasons, most often. PHP still has to load the file, analyze for code it should execute and then spit out the file. You may also have issues if php has it's default content-type output switched from text/html to say text/plain
Feyd.. Thanks for the quick reply!

I have a relatively small site with not a lot of business. I can't afford to loose the business I have. I don't really have any performance issues (I use a host and I'm way under allowables). Just seems to me like at some time in the near future all files will have some php on them so why not get the files named and indexed "correctly" now?

Posted: Mon Aug 29, 2005 1:05 pm
by feyd
the fun part is, you can map any file extension you want to have php process them.. so you could really map .html to php, if you wish.

Although, I would suggest using a mod_rewrite or something similar to pass the request through to your scripts..

Posted: Mon Aug 29, 2005 1:43 pm
by zman
Found the documentation to mod_rewrite and all it's optons....

Thanks very much. Great help and info!