Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Possible Duplicate:
Should I use a file extension or not?

Hi Guys,

When I make a site, should I use the .php extension, rewrite it to .html or just remove it (.htaccess)? What's your opinion about this?

I've always learnt that it was .html, but I don't know why. I doubt it that google doesn't care, but why should .html prefered to no extension?

share|improve this question
    
not extensions but query string is the thing that matters. Absence of query string to be certain. –  Col. Shrapnel Jan 16 '11 at 15:45
1  
Few SEO believe that "it does matter, .html is better for article directoy, etc". However, I am personally against it. Can those of you who answered, please give a citation / source / link which has a research on this and fairly establishes that, "it does NOT matter". It will help me convince those SEOs. –  shamittomar Jan 16 '11 at 16:15
add comment

migrated from stackoverflow.com Jan 16 '11 at 17:33

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Mark Henderson Jan 16 '11 at 22:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

6 Answers

It really doesn't matter, it's just personal preference. Rewrite .php as .html if you want to hide the technology you used, or if you just like it more.

share|improve this answer
    
@kemp, Few SEO believe that "it does matter". However, I am personally against it. Can you please give a citation / source / link which has a research on this and fairly establishes that, "it does NOT matter". It will help me convince those SEOs. –  shamittomar Jan 16 '11 at 16:18
add comment

When you look at the big picture it makes very little difference. Be careful when it comes time to use query string parameters but even then you should probably focus on content first.

If you are just getting started focus on two things:

  • content for the users first and the search engine second

  • links from other sites that are similar to your site

share|improve this answer
add comment

The extension gets indexed but its impact is minimal. Searching for animal html does return pages named animal.html but this is an edge case at best.

Hiding the extension is preferred however, mostly because web technologies come and go and you really want to avoid broken links to your site even if these won't happen in the near future.

share|improve this answer
    
+1 hiding extension. The users or search engines don't care what language you're using. –  Badr Hari Jan 16 '11 at 16:04
add comment

Actually, it's doesn't matter (.html or .php or .asp bla bla bla ) . But you can rewrite URL completely.

For example : http://www.example.com/member.php TO http://www.example.com/member/

Users (and maybe Google?) more like this URL method.

share|improve this answer
    
I'm really wondering, why you vote negative ? –  Eray Jan 16 '11 at 15:54
    
why google likes it more, and where have you seen an average user who even notice an address bar, not to mention whatever it's contents? –  Col. Shrapnel Jan 16 '11 at 16:09
    
@Eray, Few SEO believe that "it does matter". However, I am personally against it. Can you please give a citation / source / link which has a research on this and fairly establishes that, "it does NOT matter". It will help me convince those SEOs. –  shamittomar Jan 16 '11 at 16:13
    
@Shrapnel , Google more like /member/eray/ than member.php?user=eray . Did you really think, this is bad suggestion ? –  Eray Jan 16 '11 at 16:14
    
@shamittomar, maybe when extension is .html, Google thinks "this page is static" . And if ext. is .php , thinks "This page is dinamic" . What about /member/eray/ ? What Google think ? –  Eray Jan 16 '11 at 16:16
add comment

If you have "pretty" URLs (e.g. "http://www.example.com/profile/charly-sheen"), you don't want to have the extension, because it will reduce the weight of the other keywords in the URL (in this case: "profile", "charly" and "sheen"). If there were a ".php" in the end, "php" would most likely take some weight away from the other keywords. So yeah, you want to make your URLs as short as possible and remove everything word that you don't expect users to search for.

If you don't have "pretty" URLs (e.g. "http://www.example.com/profile.php?id=12345"), the .php doesn't matter, because your URL is crap anyway, both from a SEO as well as a user experience perspective.

share|improve this answer
add comment

Remove it. It serves no purpose, other than letting the user know which technology you would like him to believe you used to create the page. Cool URIs don't change. After the third change in page generation technology, you do not want to have a mix of .html, .php, .aspx URLs; and you actually just decided to switch to the new and promising Foogen 3.v, adding a new file extension .foog to your portfolio.

Do not remove it for the sake of SEO. Remove it for the sake of consistency and for the sake of people linking to your site (which, on the other hand, happens to be a part of SEO nowadays).

share|improve this answer
add comment