Page 1 of 2

.html to .php

Posted: Wed Feb 22, 2006 2:16 pm
by Luke
Does changing the extension of php files to html (with a .htaccess file) make the pages more search engine friendly? If so, how?

Posted: Wed Feb 22, 2006 2:39 pm
by Ree
No.

Posted: Wed Feb 22, 2006 2:49 pm
by pickle
I can't imagine it would. A php file just dumps HTML anyway so the *content* of the file would be the same. As for the file extension, I'm not sure search engines care. That said, I believe I've heard that *.shtml files are not indexed by all bots.

Posted: Wed Feb 22, 2006 2:57 pm
by Luke
I could have sworn I heard that html extensions are more engine-safe than php files. Are you guys CERTAIN?

Posted: Wed Feb 22, 2006 3:13 pm
by feyd
search engines don't care about the file extension.

Posted: Wed Feb 22, 2006 3:21 pm
by m3mn0n
You might have heard it's better to have say:

site/user/1062/

...than it is to have:

site.php?user=1062

If you're wondering about getting something like that done, research mod_rewrite for Apache

Posted: Thu Feb 23, 2006 11:01 am
by Luke
thank you

Posted: Thu Feb 23, 2006 11:18 am
by Maugrim_The_Reaper
Doesn't Google now allow query strings? In which case the url format probably doesn't matter to a search engine. Of course search engines may differ - I rarely use anything except Google so I should keep that in mind.

Posted: Thu Feb 23, 2006 11:30 am
by feyd
Google has for quite a while traversed urls with query strings.

Posted: Thu Feb 23, 2006 4:36 pm
by nickman013
What if you had php code in a html page, would it work because I have gotten problems trying it?

Re: .html to .php

Posted: Thu Feb 23, 2006 5:43 pm
by Roja
The Ninja Space Goat wrote:Does changing the extension of php files to html (with a .htaccess file) make the pages more search engine friendly? If so, how?
It depends on which search engine, however, lets focus on the big three, if we want to be reasonable. (Google, MSN, Yahoo).

In that case, no. It doesn't. All three treat both equally. Of course, unrelated is that if a php file can't handle the load (infinite loop much!?), then the search engine won't see it as often. But thats not the file extension, thats the programming/availability of the page.
Pickle wrote:That said, I believe I've heard that *.shtml files are not indexed by all bots.
All three of the majors do.
The Ninja Space Goat wrote:Are you guys CERTAIN?
No, Roja. Thats the nick, its easy to remember. Am I sure? Roja.
Sami wrote:You might have heard it's better to have say: site/user/1062/
Misleading. For the major search engines, that used to be true, but isn't any longer.

As a best practice, its still "better", because you can change content type (Moving from perl to php?) and won't have to update the url. That has nothing to do with the search engine. Search engines love query urls equally now.
nickman013 wrote:What if you had php code in a html page, would it work because I have gotten problems trying it?
Not sure what you mean by php code IN an html page. That doesn't quite make sense.

Posted: Thu Feb 23, 2006 5:53 pm
by nickman013
For example

home.html

Code: Select all

<html>
<?php
php code 
php code
?>
<font color=red>Whats up!</font>
</html>
Would the php work?

Ive tried to do this before some times it worked, sometimes it didnt.

Posted: Thu Feb 23, 2006 6:27 pm
by Roja
nickman013 wrote:Would the php work?
Only if the server is configured to parse html as php.

But doing so means it is a php file, despite the .html extension.

Re: .html to .php

Posted: Thu Feb 23, 2006 6:31 pm
by m3mn0n
Roja wrote:
Sami wrote:You might have heard it's better to have say: site/user/1062/
Misleading. For the major search engines, that used to be true, but isn't any longer.
Of course, that's why I didn't imply otherwise. :wink:

I was just trying to point him in the right direction since it was obvious that's the sort of thing he was talking about.

Re: .html to .php

Posted: Thu Feb 23, 2006 6:35 pm
by Roja
Sami wrote: I was just trying to point him in the right direction since it was obvious that's the sort of thing he was talking about.
It definitely wasn't obvious to me. The original question was specifically about making pages more search engine friendly. Those urls no longer have any impact on search engine friendliness.