#1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Dec 2004
    Posts
    2
    Rep Power
    0

    Site in PHP...best way to optimize for Google


    Hello,

    I'm new to the whole SEO thing and, from what I've gathered in my reading, crawlers do not do well with dynamic pages generated by databases. In our case this is specifically PHP. We have just spent months designing a new website in PHP in order to integrate the use of credit cards et al. Is the only solution to (re)create the static HTML pages we used previously?

    Furthermore, does the fact that our site is completely in PHP matter to directories as opposed to crawlers? Please forgive me for my ignorance in advance but there's a lot here and, well, I feel like I'm lost at sea.

    Thanks.
  2. #2
  3. Resident Black Hat
    SEO Chat Good Citizen (1000 - 1499 posts)

    Join Date
    Aug 2004
    Location
    Woodstock, GA
    Posts
    1,437
    Rep Power
    20
    The issue with search engines crawling dynamically generated web pages is that usually they contain something like this:

    ?do=newreply&noquote=1&p=148164

    Up until recently, Google didn't cache that very well or crawl it very well. I think I saw a thread that they may be doing it more now and some suspect it's because MSN is doing so.

    Regardless, you can easily get around this 'problem' entirely through the use of modrewrite (for unix based systems) or isapi rewrite (for iis based systems).

    Good luck figuring out regular expression syntax though

    G-Man
  4. #3
  5. Extremely Googled
    SEO Chat Good Citizen (1000 - 1499 posts)

    Join Date
    Dec 2004
    Posts
    1,035
    Rep Power
    501
    Google has never had a problem spidering dynamic pages. I run a site with a forum on it (vBulletin, same as this site). All the pages are in PHP with query strings and Google has never had any problems indexing it for the past few years.

    Google does, however, spider dynamic pages at a slower rate because dynamic pages usually involve database interaction and Google doesn't want to kill the sites it spiders. There's no prcatical difference between dynamic and static pages otherwise (just make sure that if you use sessions that you don't have all your URLs show the sessionID because that can cause problems).

    As far as the whole PHP vs HTML debate... I'm really not sure there's a lot of merit to it. My sites are all in PHP with PHP extensions and they do just fine for spiders. I could do the htaccess trick and try to trick you into thinking the pages you're viewing are in HTML but there's no pratical difference between this thread you're reading in HTML and the PHP code that drives it. Some people swear by HTML extensions over everything but I'm not sure how much longer that may hold true as more and more sites go dynamic. I mean with PHP/MySQL hosting as cheap as $6/mo in some cases Google's got to consider coded (not necessarily dynamic) pages on par with static sooner or later (assuming it hasn't already). Besides, Google has to know that not all HTML pages are not really true HTML pages by now.

    In the end, for me at least, it was a whole lot of hassle for what would be a minimal (if any) gain in the SERPs. It was far better to spend that time getting backlinks, IMO, than to go that route.

    My $0.02
  6. #4
  7. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Dec 2004
    Posts
    2
    Rep Power
    0

    Thanks...that's a relief


    Thank you both for your feedback--it is truly appreciated. I'm still a neophyte but with help like yours I should be able to get somewhat of a hold on it. Thanks again.
  8. #5
  9. EAT LEET!
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Sep 2004
    Location
    Seattle, WA
    Posts
    446
    Rep Power
    15
    Originally Posted by Highland
    .

    There's no prcatical difference between dynamic and static pages otherwise (just make sure that if you use sessions that you don't have all your URLs show the sessionID because that can cause problems).

    My $0.02
    Could you please explain this a little more for me. I noticed my e-com site does this and we have session ID's. How does this affect my SEO and what can I do you get around this?
  10. #6
  11. Extremely Googled
    SEO Chat Good Citizen (1000 - 1499 posts)

    Join Date
    Dec 2004
    Posts
    1,035
    Rep Power
    501
    When you create a session in PHP it assigns it an ID. Because web pages are stateless there's only two ways to pass that session ID: cookies or URL.
    The reason passing it in the URL is bad is because Google sees
    mydomain.com/page.php?PHPSESSID=123ABC
    and
    mydomain.com/page.php?PHPSESSID=ABC123
    as separate dynamic pages. So Google archives mydomain.com/page.php?PHPSESSID=123ABC which defeats the purpose of sessions (and invites some exploits involving session IDs) and causes Google to think it's found new pages every time it spiders your site since every session variable is unique for the most part. The only way around this is to use cookies to store sessions.

    There's two potential problems to this, fyi. First is that someone might be browsing with cookies turned off. It doesn't happen often but it can happen. My view is that if you want what I'm selling then you want cookies on (most carts, even non-PHP ones, use cookies). Besides, your average user usually doesn't know what a cookie is, let alone how to turn them off.

    The other is that your host might have them turned off in the INI file (you can check by using the phpinfo() function in a separate page). There is a possible method around this if you do your own coding. Before you use the session_start() function use the following line
    ini_set('session.use_cookies', 1)

    If you're using 4.3.x or 5.0.x then you can also use
    ini_set('session.use_only_cookies', 1)
    But be aware of the aforementioned problems involving cookies.

    I hope that helps.
  12. #7
  13. No Profile Picture
    Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Posts
    232
    Rep Power
    15
    I spend a lot of time changing url's to static using mod-rewrite. I also have one forum site that is NOT using static url's and it was crawled quite ok by google. So I would say do it if you have time & tech. competance.

Similar Threads

  1. Drastic Ranking Drop
    By Tiffany* in forum Google Optimization
    Replies: 1241
    Last Post: May 16th, 2006, 10:24 PM
  2. How many Unique Domains Link to Your Site?
    By randfish in forum Google Optimization
    Replies: 0
    Last Post: Sep 6th, 2004, 03:25 PM
  3. Google Recovery!
    By relaxzoolander in forum Google Optimization
    Replies: 133
    Last Post: Mar 16th, 2004, 03:42 PM
  4. Godaddy Victim? Site Migration Tips
    By rackaid in forum Google Optimization
    Replies: 16
    Last Post: Nov 7th, 2003, 03:38 PM

IMN logo majestic logo threadwatch logo seochat tools logo