Forum Moderators: coopster

Message Too Old, No Replies

PHP and Google

Does Google like php homepages

         

DFrag

11:59 pm on Dec 3, 2003 (gmt 0)

10+ Year Member



Hello all,

I am in the process of changing my clients homepage to a php page to make it more dynamic. Will this affect Google rankings and ratings?

Currently the site is doing pretty well with it's index.html page and I don't want to damage this by changing the index to a php page.

Sorry if this topic is in the wrong section...it is sort of PHP related :)

Thanks,
DFrag.

jetboy_70

12:08 am on Dec 4, 2003 (gmt 0)

10+ Year Member



Google has no problems with .php pages, but of course index.html and index.php are different filenames, and therefore you will get the usual problems associated with changing your filenames.

Why not just enable PHP parsing on .html extension files using .htaccess, or at the very least set up rewrites from the old filenames to the new.

DFrag

12:25 am on Dec 4, 2003 (gmt 0)

10+ Year Member



"or at the very least set up rewrites from the old filenames to the new."

Not too sure what you mean?

Elijah

12:27 am on Dec 4, 2003 (gmt 0)

10+ Year Member



I think he means using mod_rewrite to direct all requests for *.html to *.php.

bobnew32

2:53 am on Dec 4, 2003 (gmt 0)

10+ Year Member



What would be the rewrite code to be able to parse htm and html with php?

bcolflesh

3:01 am on Dec 4, 2003 (gmt 0)

bondjamesbond

9:18 am on Dec 4, 2003 (gmt 0)

10+ Year Member



Or you could redirect index.html to index.php using a redirect

Redirect /index.html [yoursite.com...]

Flasheart

9:32 am on Dec 4, 2003 (gmt 0)



I did the redirect thing in htaccess when I changed from html to Postnuke. From the 404 logs it rapidly became apparent that a LOT of people had bookmarked pages or were coming in from remote sites.

So... For the files that cropped up most often, I put a simple redirect in htaccess and viola, they now go straight to the new Postnuke article for the old html page.

htaccess is a very useful thing. :)

NickCoons

4:44 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



DFrag,

Setting up redirects from the old pages to the new pages is important when making HTML to PHP changes, but not so much when you change the home page. Because links usually go to www.site.com, not www.site.com/index.html (at least, that's how I build my sites).

So to any link pointing to www.site.com when you change index.html to index.php will be transparent, as long as you have your webserver setup to load index.php as the default page in a directory when none is specified (as index.html currently is).

DFrag

9:38 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



*NickCoons*

My problem is that I don't want the ratings etc in Google to be messed up by me changing from html to php. If Google ranks the domain not the page then that is ok, but I'm pretty sure it works on the pages.

DFrag

NickCoons

11:11 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



DFrag,

It does rank pages individually, you are correct. But people link to your site at "www.site.com", and your server then fetches the correct page. So Google sees the URL http*//www.site.com as the link to the home *page* of the site. It doesn't matter what the actual filename is called, as long as it can still be referenced the way Google wants to reference it, as http*//www.site.com.

This is not necessarily true for sub-pages. For instance, I may have a page link http*//www.site.com/contact.html. If I change this to contact.php, I have then changed the URL, and I would need to configure an appropriate redirect. It is the URL that is important, not the filename. If the filename is not part of the URL, then changing it won't be noticable to Google or anyone else.

ergophobe

10:25 pm on Dec 5, 2003 (gmt 0)

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




messed up by me changing from html to php

In any case, as Jetboy said, don't change your page names. Just name your index page as index.html and set PHP up so that it parse .html pages. Google will have no idea.

The link provided by bcolflesh should have all you need.

Better yet, do the rewrite, but not to *.php, but rather use "cool URIs" in Tim Berners-Lee lingo.

[w3.org ]

Tom

keyplyr

6:40 am on Dec 8, 2003 (gmt 0)

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



What would be the rewrite code to be able to parse htm and html with php?

Just add this line to your .htaccess file:


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

Adjust .htm or .html as applicable.