Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

Html Vs Php Pages


  • Please log in to reply
30 replies to this topic

#1 centaur

centaur

    HR 1

  • Members
  • Pip
  • 4 posts
  • Location:Lancaster, OH

Posted 31 December 2003 - 01:10 PM

I have a question regarding server technologies and how they affect rankings. I've heard some say something along the lines of the following:

If you have a PHP dynamically generated website you need around 5 static HTML pages in order for some spiders to pick you up, and that if you dont have static HTML pages it will hurt rankings.


I don't quite believe this myself given the fact that underneath these page extensions is just plain old HTML. I also don't quite believe this because I've seen sites developed solely in PHP and their rankings were fine in SERPs.

Is there any truth to this statement or is it just a complete myth?

Thanks all!

#2 OldWelshGuy

OldWelshGuy

    Work is Fun

  • Moderator
  • 4,713 posts
  • Location:Neath, South Wales, UK

Posted 31 December 2003 - 01:20 PM

I would say Myth, as PHP can cause problems for Spiders, but only a few tweaks are needed to make them 100% acceptable.

I see that Grumpus is reading this thread, he is far better to comment than I :wacko:

#3 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 31 December 2003 - 01:23 PM

The statement is exactly wrong.

The only real thing you need to consider is complex querystrings - meaning multiple variables being passed at one time like page.php?this=1&that=50938&theother=dogscats )

Every crawler is capable of moving perfectly well through php pages that have only one variable. Most will go through 2 variables (assuming that the values of the variables themselves aren't overly long). And Google is even crawling some 3 variable URL's if the site and linking structure is layed out in such as way that Google can make sense of what those variables are doing.

The trick - as you've already got a grasp on - is that your page needs to spit out good clean HTML. Stay consistent in how you name everything, too.

Spiders cannot submit a form like a search box, so make sure there is an anchor link <a href=> to every page you want crawled.

There's nothing wrong with having static map pages, but they take time to maintain so it's really not worth the bother.

G.

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 31 December 2003 - 01:24 PM

Complete myth Centaur.

PHP pages are just fine as long as you take care to not do a few things. Namely, don't require Cookies to access any page you want spidered; don't require a SessionID to be set on any page you want to be spidered and don't use long query strings or query strings with a series of variables.

There is a lot more info about this down in the Dynamic threads below. Those will be a good read for you if you're interested in dynamically created sites/content.

<EDIT> :wacko: Looks like we were all here at the same time! Howdy OWG and Grumpus! </EDIT>

#5 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 31 December 2003 - 01:25 PM

I see that Grumpus is reading this thread, he is far better to comment than I


Maybe, but yours said pretty much the same thing as mine with only one sentence. :ale:

Brevity isn't my strong suit. :wacko:

G.

#6 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 31 December 2003 - 01:28 PM

Good point on Cookies, Randy - I forget that (see what happens when I try to be brief?) The URL being passed must contain everything that is needed to display the page. No session variables (which are stored in cookies), nothing that requires you to log in for the page to display, etc. It's fine to use cookies on the site, but the spider is only going to see what the page looks like without the cookie - so make sure the page doesn't throw an error if no cookie can be found.

G.

#7 Fritz

Fritz

    HR 3

  • Active Members
  • PipPipPip
  • 62 posts
  • Location:Hatfield, PA

Posted 31 December 2003 - 09:56 PM

This may be the wrong place to ask this, but...if I convert my .html pages to .php pages, what will be the impact to my search engine status?

Only one of my pages is currently ranked well, and that is my domain's default page (index.html). If that becomes index.php, all else staying the same, will the page stay in the same spot in the rankings?

#8 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 31 December 2003 - 10:02 PM

You'll need to put a "Moved Permanently" redirect in place of the old index.htm page.

If there's no reason to go php, though (i.e. you're not adding some dynamic content or anything) there's no reason to change.

There's no ranking benefit or difference between php or htm pages. Your problem is that if you rename everything, you're going to have to leave placeholders and redirects for the spiders so they can see the new layout. It can run into a lot of work and some hosts don't have very good support for doing this type of thing.

G.

P.S. If you need more info, feel free to ask and we'll see about how and if you can do it with your current host.

#9 Fritz

Fritz

    HR 3

  • Active Members
  • PipPipPip
  • 62 posts
  • Location:Hatfield, PA

Posted 31 December 2003 - 10:11 PM

Thanks, Grumpus, but not sure if I entirely follow you there.

Since it is the default page, wouldn't the spiders find it just because there are incoming links (not specifying a page) to my domain? At most, I would think (which I sometimes do at my own peril) that a redirect from index.html to index.php should take care of everything....

My main reason to go to php is so I can implement some visitor tracking logic in each page.

Some of my pages are php anyway. And I like having dynamically-generated pages so I can make changes more easily.

(And I have to ask this...is that a photo of you, looking just like Christopher Reeve, or is that your Superman avatar?) ;)

#10 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 31 December 2003 - 10:57 PM

The reason you want a redirect is that a spider may have the "index.htm" even though it's not always used in the index. But yes, "Moved permanently" redirect page will take care of it and you'll be fine. There will be a burp in quantified PageRank as the new php page will have to be recalculated and that'll take a month, but it shouldn't do a noticable drop in traffic - especially if the redirect is done right.

Seems like you've got a handle on it.

G.

Oh - and yeah, that's me, though I don't think anyone's said I look like Christopher Reeve before...

#11 cothrun

cothrun

    HR 1

  • Members
  • Pip
  • 1 posts

Posted 31 December 2003 - 11:02 PM

Assuming Apache is the webserver you could configure it to parse html files as PHP. Configure this either in the httpd.conf or in a .htaccess file to enable it per-directory.

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

You'll impose a small extra load on the webserver if it has to look through every html file for PHP code but you'll save some time creating the redirects for every page.

#12 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 31 December 2003 - 11:02 PM

Even if every incoming link to your current index.html page is pointing to something like www.domain.com/ (without the .html filename) you'll still want to either do a 301 Redirect or some type of notice that the page address has changed Fritz.

I don't have an opinion one way or another whether the SE's would automatically transfer the PR for the old html page to the new php page automatically. I've never tested it personally. Logic would say that they should, but since they don't view things like we do with a browser I have a sneaking suspicion that a problem could arise.

That's not the reason I suggest some type of redirect of Page Moved message though. I think you should do that for your visitors who may have bookmarked your site. Be kind to your return visitors by either getting them to where they thought they were going, or at least give them some sort of message pointing them in the right direction.

If you happen to be keeping the same filenames as they are now, simply replacing the extension (ie second-page.html will become second-page.php) you should be able to use a single RewriteRule to automatically forward everybody to the correct new page, and still deliver a 301 Permanently Moved message for the search engines. That would make the most sense to me, assuming your server environment and host will allow you to do it.

Nobody can answer that question for you except your hosting company. If they're agreeable but don't know how to do it simply find out what your server environment is and someone here can surely help out.

Oh, IMO the reason you mention wanting to change is a very, very valid one. It'll be worth the pain in the long run for you.

#13 Scottie

Scottie

    Psycho Mom

  • Admin
  • 6,293 posts
  • Location:Columbia, SC

Posted 31 December 2003 - 11:24 PM

Welcome to the forum, cothrun! :aloha:

#14 Grumpus

Grumpus

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 786 posts

Posted 01 January 2004 - 10:43 AM

Oooo - the new guy has the answer! Thanks cothrun! Great suggestion...

Yup yup - that's what I'd do, if you can do it with your host - teach apache to parse the HTML extension as PHP. No waiting for the PR transfer or anything! You can also put your tracking code on every page - not just the front one.

The only caveat, here, is that if your site is large, the spiders may hammer it a bit. Spiders slow themselves down when they see the php or asp or other "dynamic extension". This is done as a curtesy because dynamic pages use a lot more of the server's resources to load. If a spider hits at it's normal rate and you have several spiders and a bunch of users, it can bring the pageload times down to a crawl - or worse, crash the server.

If you go this route, you should start naming all new pages that you add with the PHP extension so the spiders only hammer the older stuff - which, if there are 100 pages or less - can be gobbled up pretty quickly. Spider "hammering" really only comes into play (in a noticable way) on larger sites - say maybe 500 pages or bigger.

G.

#15 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 01 January 2004 - 06:31 PM

Check with your host before making a change to have html files parsed pre-delivery. Many expressly prohibit this kind of thing on a shared hosting environment because of the potential server load issues. But if you get their approval first, you're set.

Imagine every page on 400+ domains having to be parsed before delivery and you'll understand why many host prohibit this technique. A dozen or so really busy sites using this method would likely bring the server to its knees, affecting every site and every process on the server, not just the domains doing the extra parsing.

If your host balks at the idea of html parsing, think 301's. They're pretty simple to do.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users