Forum Moderators: open

Message Too Old, No Replies

Changing index.htm to index.php

Will my rankings be effected?

         

dhdweb

9:20 pm on Oct 10, 2002 (gmt 0)

10+ Year Member



This may be a dumb question but I don't know the answer.

Will changing index.htm to index.php have any effect on my rankings?

I am placed very well at the moment (1st page on most keywords) and I don't want to loose that!

I need to add a php function to index page, other than that the page will remain the same.

dhdweb

andreasfriedrich

9:37 pm on Oct 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Search engines, just as anybody else identifies a certain resource on the web by its URL. If you change the URL of a resource it will be considered a new resource unless you take certain measures to tell them otherwise.

You can let useragents know that an old resource is now available under a different URL by sending a 301 Moved Permanently status code and the new URL in the Location header. This is the methods suggested by Google. This should not hurt your ranking.

But if you think about it, changing the URL of a resource just because the underlying technology used to produce that resource changed is a bad idea. If you change to Perl as your scripting language in the future, do you want to change your extension to .pl?

Think about using some internal rewriting technique or configure your webserver to treat files with the extension of .html as php code.

Andreas

dhdweb

9:40 pm on Oct 10, 2002 (gmt 0)

10+ Year Member



If the URL is www.anysite.com

then is index a given no matter the extension?

as opposed to www.anysite.com/index.htm

andreasfriedrich

9:53 pm on Oct 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If there is no file name the server will look for a default index file. Using Apache you can set it with the DirectoryIndex directive.

If you put

DirectoryIndex index.php
in your .htaccess file and take care to refer to that page only without the file name and you did so in the past as well then all will work well using this method.

Andreas

dhdweb

9:56 pm on Oct 10, 2002 (gmt 0)

10+ Year Member



Forgive me, but I am not sure you understand my question.

Setting up my server is not problem, my rankings in google are!

The link in google does not reffer to the index file, it only reffers the domain name.

andreasfriedrich

10:14 pm on Oct 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All I´ve been trying to say is that what happens internally to your webserver cannot be seen by Google and cannot affect your ranking.

So if all your external links refer to the domain name and the link in google refers to the domain name then there should be no problem as far as ranking is concerned.

Andreas

brotherhood of LAN

10:39 pm on Oct 10, 2002 (gmt 0)

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



dhd, maybe check your backlinks and see if any of them reference the filename as well as the domain name, and hopefully what andreas said will sort the prob.

jady

11:40 pm on Oct 10, 2002 (gmt 0)

10+ Year Member



Like they said above, as long as your backlinks are going to www.yourdomain.com and not www.yourdomain.com/index.html it will not affect your Page Rank. We have a very high ranking site that is default to index.php - we just ensure that all inbound links go to the domain (without the index.whatever).

Now the question probably still lies - Will an equally ranked site do better if .html or .php... This I can not answer for sure, but some of our Client sites do well with .php index and other pages..

Hope it helps... :)

MHes

11:42 pm on Oct 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi dhdweb

I wouldn't do it.

If you have good rankings, leave well alone, there is too much uncertainty about this. Google likes .html pages. Things will change, maybe they are already, but I would play safe if you can. Put the php on another page!

jady

11:46 pm on Oct 10, 2002 (gmt 0)

10+ Year Member



MHes, I agree, it is a gamble. We have opted out of using a php index page if at all possible - but if something in specific needs to be achieved, its a gamble that you will have to try one month..

Slade

12:12 am on Oct 11, 2002 (gmt 0)

10+ Year Member



If you are on apache, do some searches here for url rewriting and .htaccess(spelling?)

As someone else above said, you shouldn't have to change your filename just because you changed the underlying scripting language.

You can use any_file_name.php and have it appear to the user as index.html, and without messing up any previous linking or rankings. (I have some code I can post, if you don't find what you're looking for.)

brotherhood of LAN

12:15 am on Oct 11, 2002 (gmt 0)

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



AddType application/x-httpd-php .htm

for the .htaccess

All other .htm's will be parsed with the PHP engine.....I hear its supposed to give a slight performance hit but should not be too much of a problem doing this. (only applies if you have some .htm's that do not need to be dynamic i suppose)

chiyo

2:33 am on Oct 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We changed many root and directory root URL's to index.php from default.htm 6 to 9 months ago. No discernable hit on search engines. In the case of pages that were not the index of the site of directory we used a 10 second redirect from the old htm page. From our limited experience, no problem.

Adam_C

8:59 am on Oct 11, 2002 (gmt 0)

10+ Year Member



Going off on a bit of a tangent...

does google have a preference for *.html files over any other types? Particularly, does it prefer *.html to *.htm? Or *.shtml?

MHes

9:11 am on Oct 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To date... htm or html...No

shtml....yes

Change endings as mentioned previously.

dhdweb

12:41 pm on Oct 11, 2002 (gmt 0)

10+ Year Member



Thanks everyone for your posts!

I am going to play it safe here and wait until I get an answer directly from Google, I just hope they don't take forever to answer my e-mail to them.:)

Personaly, I don't see why changing the file extention would make a difference since no outside links refer to the index file, they only point to my domain name. That plus the fact that the page will still be writen in html and I am not changing the current content but just adding some php functionality.

Anyway, when I hear from Google, I will let you thier answer on this.

dhdweb

KakenBetaal

5:59 pm on Oct 14, 2002 (gmt 0)

10+ Year Member


This might be of interest to you. I recently installed some phpBB forums, and placed them in http://www.mydomain.com/forums/

I then placed a link to the forums in my navigation bar which is on every page in my site. The link was to /forums/ (rather than /forums/index.php).

After two Google updates, I can see a definite difference in PR between http://www.mydomain.com/forums/ (PR5) and http://www.mydomain.com/forums/index.php (PR3)

Google therefore hasn't successfully determined that the two URLs in fact point to the same page. In contrast, Google has successfully determined this for http://www.mydomain.com/ and http://www.mydomain.com/index.html

Slade

7:13 pm on Oct 14, 2002 (gmt 0)

10+ Year Member



KakenBetaal:

If you set up a 302 redirect on the specific request of one or the other, Google could that they are the same.

After pondering it some, though... I don't know how much this would affect the page's PR. My original theory was you would improve the page's PR by merging the pages inbound links. I have not convinced myself of this, yet.

shady

8:04 pm on Oct 16, 2002 (gmt 0)

10+ Year Member



If I change my .php pages over to .htm pages, will google still consider that pages are different when they have different parameters:

e.g.
product_info.htm?prodid=1
product_info.htm?prodid=2

etc..

As .htm pages are supposed to be static, is there a possibility that it will only index one product?

andreasfriedrich

8:43 pm on Oct 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not go for URLs like

product_info_1.htm
product_info_2.htm

No questions about whether pages are considered to be the same, whether they will be indexed, whether the query string is too long, whether Google will do this if something happens in China.

Simple static URIs that every spider will follow and which may even be remembered by your users.

There is a reason why Brett uses URIs like [webmasterworld.com...] instead of [webmasterworld.com ]. There is no reason why you shouldn´t do it too.

Andreas

shady

8:52 pm on Oct 16, 2002 (gmt 0)

10+ Year Member



I do kind of take that approach by generating specific html pages for my dynamic sites. I do this using a VB program which connects to the mysql database etc.. BUT, the shopping cart system that I use is rather complex and would require a lot of work to change "properly". Don't get me wrong, the work does not frighten me, but if I could "get away" with simply running the .php pages AS html pages, this would be a better short term solution until I have time to do it better.

People in this forum are suggesting that we can run php scripts in the disguise of html but if only one instance of a dynamic page is indexed, then I cannot see much benefit!

Can anybody confirm whether SE spiders will treat index.htm?id=1 as a different page to index.htm?id=2 (?)

(Thanks for your comments, though, Andreas!)

Birdman

9:43 pm on Oct 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can anybody confirm whether SE spiders will treat index.htm?id=1 as a different page to index.htm?id=2 (?)

I just checked and had multiple listings for an asp page.

/custom.asp?itemnum=ct001
/custom.asp?itemnum=ct002
/custom.asp?itemnum=ct003
/custom.asp?itemnum=ct004
/custom.asp?itemnum=ct005
...and so on

shady

10:13 pm on Oct 16, 2002 (gmt 0)

10+ Year Member



Hi Birdman

I think I've maybe not made my question clear!

SEs will index a php/asp page as seperate pages if they have different parameters (eg.?id=1,?id=2) because they are known to be a dynamic page. The SE therefore expects that they may be different and will treat them as different pages, although they essentially are the same document.

My question relates to running php documents with an html/htm extension. As an html page is a "Static" page, will the search engine only index it once, even though there are many links to the page with different parameters?

frontpage

11:38 pm on Oct 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I recently got the bug to change from html to php due to more functionality/database/etc.

My listing in google is [domainname.com...] (not real domain). So I changed my index page from index.htm to index.php

And you know what? Nothing bad happened. Did not lose any page rank, traffic, search positions. If anything else, this month I have the most traffic I have ever had. This is probably due to the extra features that PHP allows me to incorporate into my site.

So...be a leader not a follower like other webmasters. Experiment and have fun.

shady

11:46 pm on Oct 16, 2002 (gmt 0)

10+ Year Member



Thanks Frontpage!

I do try to have fun, but money is unfortunately more of an incentive.

It WILL make no difference as the default page, as this is being served up with only the domainname in the URL - the SE doesn't see this.

It is where the .php is specifically used in the URL (e.g. http:/domainname.com/product.php), that causes the SE to spider less of the site (generally speaking I believe that 1 level of spidering happens in php compared to the entire site being indexed using .html pages).

Please feel free to correct me if I am wrong, you guys!

Trisha

7:07 pm on Oct 17, 2002 (gmt 0)

10+ Year Member



In the next day or so I will be changing the extensions of all of the pages on one of my site's from .html to .php. Currently the index and a couple of other pages have a PR of 5, the rest 4 or below. I don't expect the new pages to show up in the index until the Nov. update. I can post an update here about how or if my site is affected (or should it be effected?), if anyone is interested.

shady

7:24 pm on Oct 17, 2002 (gmt 0)

10+ Year Member



I wouldn't expect it to affect the actual pages you change, just the deeper spidering if you have sub-pages.