View Full Version : Is .html better for SEO than .php?
I am in the process of moving 2 sites to Powweb. The old hoster did not allow .htaccess files so I had to rename all the files to .php. On Powweb I can use .html.
My question is: which is better for SEO? Do the Google bots rank .html files higher than .php files, or does it make no difference?
I understand that there is a rewrite command that will make all the .php files appear as .html, but I suspect this has some overhead in the .htaccess. These sites are small enough that I would rather manually rename the files, if it is better for SEO.
Anyone know for sure? Thanks, kuau
YvetteKuhns
11-8-07, 09:04 AM
Server scripts that take longer to load can sometimes make your site unavailable to search engines. The file extension .htm, .html, .php, .shtml or other isn't as important as the load time (accessibility) and the URL itself.
A URL that has a query in it such as http://www.yourdomain.com/index.php?cat=category1+item=item1 can be messy for search engines. If the URL is renamed to http://www.yourdomain.com/index.php/cat/category1/item/item1 where special characters are replaced with the slash, your pages could be better indexed. See http://www.healthyweightlossplans.com/viewproduct.php/u/total_control/c/11 for an example URL.
Search engines have recently improved and can read URLs better than before, but it still helps your ranking to use the keywords in your URL. If you use a bunch of URLs that look similar, the search engine may skip indexing other URLs or make them less relevant.
I understand that there is a rewrite command that will make all the .php files appear as .html, but I suspect this has some overhead in the .htaccess.
I used this when my site grew much larger.
These sites are small enough that I would rather manually rename the files, if it is better for SEO.
While the sites are still small, choose php for your extension. If you need to change hosts and you can't use .htaccess, you could still use php! ;)
Thanks, Yvette:
I understand what you are saying, and what you said is totally accurate as pertains to query strings in URLS, but my situation is much simpler, so it didn't really answer my basic question. I have no queries in my URL's. I am simply asking if the search engines rank these URL's differently...
index.php
index.html
Depending on the answer to that, I may take your advice and leave the files as .php.
Thanks, kuau :)
YvetteKuhns
11-8-07, 09:24 AM
There are two things that can affect search engines, availability and readability of URLs. Simple URLs can have any extension as long as your site loads quickly. Search engines don't rank index.htm any higher than index.php.
When I first took over this site, it was all done in frames with no SEO (no meta-tags, no alt tags, text was almost all in jpegs, etc). Nevertheless it had a page rank of 3. I rewrote the whole site using css, php includes, SEO practices, but had to use all .php file extensions. I did simple redirects from the .html versions of the files to the .php files. Now the page rank is 2. The only thing I can think of is that Google didn't like the .php. Do you have any other explanation? Thanks, kuau
YvetteKuhns
11-8-07, 09:46 AM
The new number one site may have made changes. If not, the search engines may have recalculated your ranking based on your new keyword density. Your ranking may increase or decrease while your pages are recached.
One of my clients was bouncing between 3 and 2 and sometimes reached the number 1 position. The recent upgrades for search engine algorithms, the recent changes to the website and possible updates to competitor sites can all affect ranking.
You changed the file extension for your pages. To the search engines, the php pages are NEW pages and the html pages are OLD pages. The old pages should be removed from the server and eventually from the search engine cache. The new pages should be indexed and appear in listings. Remember to update your site map, if you have one.
Another client of mine had html pages, then their previous web designer changed to php pages and they seemed to disappear from search engines. They contacted me and their php pages are now found. They had a site map web page and site map xml file, but their website navigation needed work. I made it better for humans and search engines to navigate the website.
You are probably seeing a temporary change as the old pages are being removed and the new pages are being cached.
rainbore
11-8-07, 09:59 AM
When I first took over this site, it was all done in frames with no SEO (no meta-tags, no alt tags, text was almost all in jpegs, etc). Nevertheless it had a page rank of 3. I rewrote the whole site using css, php includes, SEO practices, but had to use all .php file extensions. I did simple redirects from the .html versions of the files to the .php files. Now the page rank is 2. The only thing I can think of is that Google didn't like the .php. Do you have any other explanation? Thanks, kuau
The PageRank score you see in the Google Toolbar is based on the quantity and quality of the links that point to the page you're viewing at the time. It is not affected by the content of the page itself (unless it incurs a penalty - which is very rare because the kind of penalties that affect PageRank are for deliberate violations). Many sites have seen their PageRank score drop by a point recently, but that's most likely due to Google recalibrating the Toolbar PageRank display and taking some action against paid links.
YvetteKuhns
11-8-07, 11:10 AM
I don't bother looking at Google Page Rank (the score between 0 and 10). Only your listing ranking for your keyword phrases matter. Were you referring to the Google Page Rank or your search engine ranking on Google?
Were you referring to the Google Page Rank or your search engine ranking on Google?
And in the end only the latter really matters. Your site's visitors don't care what your Page Rank (PR) is. If they find you on the first page of returns on Google (preferably "above the fold"), that's all that really matters. Don't stress about Google PR -- it's been seriously "devalued" over the last year or so.
Good luck,
Kevin
Croc Hunter
11-8-07, 09:55 PM
I suggest you use .html rather than .php kuau77. It is in general a more easily read format than php. The beauty of php is the ability to pull information from a database. Such as a forum or CMS does. Depending on the visitors status, (eg: bots don't log into your forum) the text they see may vary. While it's efficent, the text is pulled into the page whereas with html it is sitting there static on the page.
I know in your case the .php is simply an extension and for all intense purposes the pages are "static". The bots don't know that. If the see html they'll more likely rely on the actual page content.
YvetteKuhns
11-9-07, 09:11 AM
In the past, html would have been a better choice. Now it really doesn't make much of a difference in your case. Changing file names means your new pages are considered new, so if you have .html pages now, you may want to keep them or use .htaccess to redirect those URLs to the php equivalents of those pages.
You should not have two or more pages with the same contents. So you should remove old files and redirect using .htaccess. Using META redirects are not as reliable and discouraged since many people abuse them.
Croc Hunter
11-9-07, 10:21 AM
In the past, html would have been a better choice. Now it really doesn't make much of a difference in your case. Do you have unbiased proof of this? If php = html to Google surely he should keep php and not use htaccess. Most Google bots now know when they've been "htaccess'd".
YvetteKuhns
11-9-07, 10:47 AM
I have Google ranking results for clients that show no problems with php files. Even shopping cart pages get indexed. Type hdrcoupe.com in the top three search engines and see the php pages from the main site and the listings from the new Zen Cart.
I found no mention on Google's Webmaster Guidelines (http://www.google.com/support/webmasters/bin/answer.py?answer=35769) that says it prefers one extension over another. It simply mentions possible problems with complicated URLs such as dynamic URLs created by a database query. I also didn't see it at Windows Live search (http://help.live.com/help.aspx?mkt=en-us&project=wl_webmasters) or Yahoo search (http://help.yahoo.com/l/uk/yahoo/search/basics/basics-18.html).
A site map and/or great navigation helps.
troycawley
11-9-07, 05:42 PM
A more important issue would be:
If you change your urls to .html, ensure that you '301' redirect the old .php file to the new .html file.
I seriously doubt, though, that .php vs. .html makes any difference whatsoever.
I recommend leaving well enough alone.
YvetteKuhns
11-9-07, 06:05 PM
Troy, if you read the first post, you will see that the files are already php files. I agree with what you said and stated the same earlier. Thanks for the confirmation for the sake of kuau77 who started the thread.
troycawley
11-10-07, 06:41 AM
Troy, if you read the first post, you will see that the files are already php files. I agree with what you said and stated the same earlier. Thanks for the confirmation for the sake of kuau77 who started the thread.Yeah, my post was pretty much gibberish, as I re-read it this morning, so I changed it.
omegaman66
11-11-07, 03:59 AM
It sounds like you are considering having powweb servers treat all your old php files as php files by having the NEW htm extention treated as a php file by powweb after renaming each file to html. I don't believe that will gain you anything with the search engines. If the pages are currently php then I would leave them as php simply because links to them will be lost unless the links are updated.
Croc Hunter
11-11-07, 04:29 AM
Not exactly omegaman66, kuau77 asked if HTML is more SEO friendly or "ranked" higher than PHP. It's quite simple, yes. But even for a small site changing the extensions by hand as kuau77 planned to will break previous links, SE listings etc as all said above, it's a personal choice. I recently overtook a small ASP website, rebuilt it in HTML and with a know how in 2 weeks it's listed above the old website which I've not touched. I'll soon delete the old.
The reason it dropped from PR3 to PR2 most likely has nothing to do with file extension but is due to the "simple" redirection method used.
omegaman66
11-11-07, 04:03 PM
I am in the process of moving 2 sites to Powweb. The old hoster did not allow .htaccess files so I had to rename all the files to .php. On Powweb I can use .html
No host requires php and disallows html so it sounds like they have a php site and want to convert the php to html. This can be done without dropping any of the php code by having powweb servers treat all html pages as php pages via .htaccess.
Page.html is different than Page.php so back links will now point to the wrong page. Redirects and trying to get old links to point to the proper url can affect your traffic.
Every page on my site is php, and right now I am at PR3, this has fluctuated from 0 to 5 over the years, I hardly pay any attention to it anymore.
YvetteKuhns
11-12-07, 09:55 AM
I had a client on a Windows server who could not use .htaccess files. We used a default (index) page that contained a case statement to redirect multiple domains and/or urls. I think I understand the old server vs. new server situation described by kuau.
The files are already php files and may already appear in the search engines. There is no need to rename the php files to html files in any manner.
vBulletin v3.6.0, Copyright ©2000-2010, Jelsoft Enterprises Ltd.