Forum Moderators: coopster

Message Too Old, No Replies

Switching from HTML to PHP

         

cobraplant

9:50 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



Does anyone know if switching a homepage from index.html to index.php affects ranking? I plan to use a 301 redirect, but I also don't want to disrupt my page ranking on various search engines. Any thoughts?

jatar_k

9:52 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld cobraplant,

I can tell you for sure that it will

index.html and index.php are different pages

the original should disappear until such time as the redirect is followed and the new page can get into the index

I would suggest not changing a page extension. If you would like to add php parsing for the .html extension then you can make a change to the server to allow it

are you using Apache?

inbound

9:55 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The point about enabling php parsing of .htm or .html files is a good suggestion. I have used this to get over the same issue, one thing to consider though is that it will parse every document that ends in that. This will not be a problem on a server that is well resourced, but if you are struggling at the moment with load it may push it over the edge.

cobraplant

10:32 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I had a suspicion that switching from html to php would affect my ranking, but I wanted to make sure. So, if I were to add php parsing for the html extension, exactly how do I do that? I have Apache installed on my server, but I'm not actively using it.

All of my web pages have an HTML extension. I've been testing an RSS feed on a PHP test page, and now I want to install it to my home page. So, it is only the home page, index.html, that will have the PHP codes.

I'm very new to PHP, and after testing the RSS feed, I'm beginning to see its elegance. I wish I had it installed from the beginning!

So, what do I need to do to add PHP parsing for my HTML extension?

jatar_k

10:51 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



is this a server under your control or a shared host?

cobraplant

12:34 am on Nov 9, 2005 (gmt 0)

10+ Year Member



The server is under my control. I have full access to the control panel.

jezzer300

1:44 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



If you are particularly worried and you have a Linux server you could create an .htaccess file in the root folder and configure it to give .php files when .html files are requested. Or even just the main index page if thats what you want.

Something like this in your .htaccess file should work (you can use wildcard * for all files):

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^index.html$ index.php
</IfModule>

---

From what I've discovered .php and .htm are indexed just the same, but remember that index.php?refer=1 and index.php will both be indexed and ranked seperately. If you change to index.php and your inbound links are pointing to your domain, I would have though your ranking would remain. If the links point to the file index.html that's another matter, all your inbound links will need to be updated!

jatar_k

4:14 pm on Nov 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that would be specifically if you wanted to change the name

to add php parsing you could add something like this to an .htaccess file

AddType application/x-httpd-php .php .html

cobraplant

7:25 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



Thanks for all your help! I'll give the php parsing a whirl and I'll let you know how it turns out.

cobraplant

2:50 am on Nov 10, 2005 (gmt 0)

10+ Year Member



I used the code you provided and added it to my .htaccess file. It works beautifully! Again, thanks for your help.

jatar_k

3:41 am on Nov 10, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



glad you got it sorted cobraplant