PHP , url and Google

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dan

    PHP , url and Google

    I have a site that I developed that uses I page main.php. all content
    is decided by a variable. It's a magazine web site so there are
    issues per month. I use a session variable to keep track of what
    issue they are looking at. From that session variable I can change
    color, background and menu list. Now the session variable is set by
    default according to what month it is.

    Now, there are regular articles that are in each issue so in each
    issue you get:
    main.php?dir=as phalt

    And according to what issue the session variable is set to you will
    get any of the articles by the same author.

    QUESTION
    If Google scans a previous month and it comes up on Google, it will
    send you to the current column and not the older one that had the key
    word in it. How can I make a URL that will allow Google to know the
    difference?

    Thanks for any help!
  • Kevin Thorpe

    #2
    Re: PHP , url and Google

    dan wrote:[color=blue]
    > I have a site that I developed that uses I page main.php. all content
    > is decided by a variable. It's a magazine web site so there are
    > issues per month. I use a session variable to keep track of what
    > issue they are looking at. From that session variable I can change
    > color, background and menu list. Now the session variable is set by
    > default according to what month it is.
    >
    > Now, there are regular articles that are in each issue so in each
    > issue you get:
    > main.php?dir=as phalt
    >
    > And according to what issue the session variable is set to you will
    > get any of the articles by the same author.
    >
    > QUESTION
    > If Google scans a previous month and it comes up on Google, it will
    > send you to the current column and not the older one that had the key
    > word in it. How can I make a URL that will allow Google to know the
    > difference?
    >
    > Thanks for any help![/color]

    What a chestnut this is. Your problem is that you are generating content
    which is not identified completely by the url. There's no way that a
    search engine can deal with this. All of them work the same way;
    indexing the URL which generated the text they have analysed.

    What you need is to build a system so you can give a URL to go directly
    to an article placed in whatever context you wish (several article
    references may return the same page):

    Or better still as some search engines still don't handle GET parameters
    properly:

    ...and articles.php can pick out the article ref from PATH_INFO

    Secondly you want to feed those to Google instead of your main url. You
    can check the user-agent header for Google and redirect to a plain list
    of all your article URLS. Google will then happily index them all for you.

    Comment

    • dan

      #3
      Re: PHP , url and Google

      Well, in stead of using session variables, is there an easy way to
      append a url variable to every hyperlink? Obviously there are
      thousands of link in the site so I'm wondering if there is a way to
      add the Issue variable to the end of every hyperlink so Google will
      know.

      Also does anyone know of a good tutorial on PHP and[color=blue]
      > http://www.server.com/articles.php/3d56fe435e42.html
      > ..And articles.php can pick out the article ref from PATH_INFO[/color]

      Thanks


      Kevin Thorpe <kevin@pricetra k.com> wrote in message news:<4018dc0f$ 0$21703$afc38c8 7@news.easynet. co.uk>...[color=blue]
      > dan wrote:[color=green]
      > > I have a site that I developed that uses I page main.php. all content
      > > is decided by a variable. It's a magazine web site so there are
      > > issues per month. I use a session variable to keep track of what
      > > issue they are looking at. From that session variable I can change
      > > color, background and menu list. Now the session variable is set by
      > > default according to what month it is.
      > >
      > > Now, there are regular articles that are in each issue so in each
      > > issue you get:
      > > main.php?dir=as phalt
      > >
      > > And according to what issue the session variable is set to you will
      > > get any of the articles by the same author.
      > >
      > > QUESTION
      > > If Google scans a previous month and it comes up on Google, it will
      > > send you to the current column and not the older one that had the key
      > > word in it. How can I make a URL that will allow Google to know the
      > > difference?
      > >
      > > Thanks for any help![/color]
      >
      > What a chestnut this is. Your problem is that you are generating content
      > which is not identified completely by the url. There's no way that a
      > search engine can deal with this. All of them work the same way;
      > indexing the URL which generated the text they have analysed.
      >
      > What you need is to build a system so you can give a URL to go directly
      > to an article placed in whatever context you wish (several article
      > references may return the same page):
      > http://www.server.com/articles.php?article=3d56fe435e42
      > Or better still as some search engines still don't handle GET parameters
      > properly:
      > http://www.server.com/articles.php/3d56fe435e42.html
      > ..and articles.php can pick out the article ref from PATH_INFO
      >
      > Secondly you want to feed those to Google instead of your main url. You
      > can check the user-agent header for Google and redirect to a plain list
      > of all your article URLS. Google will then happily index them all for you.[/color]

      Comment

      • Philipp Lenssen

        #4
        Re: PHP , url and Google

        dan wrote:
        [color=blue]
        > I have a site that I developed that uses I page main.php. all content
        > is decided by a variable. It's a magazine web site so there are
        > issues per month. I use a session variable to keep track of what
        > issue they are looking at. From that session variable I can change
        > color, background and menu list. Now the session variable is set by
        > default according to what month it is.[/color]

        And that's a bad idea -- a URL should be uniquely identiying content
        the day it sees the light of the Web. So you should also put the month
        in the variable like this:

        main.php?dir=as phalt&month=200 4-01
        main.php?dir=as phalt&month=200 3-12
        etc.

        This helps for...
        - Bookmarks
        - Google
        - All other search engines
        - Links from the outside
        - etc.

        Now you might actually do a Google-referrer hack using the Google Web
        API (you can find out which content is actually stored in Google for
        your URL at any given moment in time by querying the Google Cache).
        But instead of trying to debug the symptom, fix the source of the
        problem.

        Hope it helps!

        --
        Google Blogoscoped
        A daily news blog and community covering Google, search, and technology.

        Comment

        • dan

          #5
          Re: PHP , url and Google

          > And that's a bad idea -- a URL should be uniquely identiying content[color=blue]
          > the day it sees the light of the Web. So you should also put the month
          > in the variable like this:
          >
          > main.php?dir=as phalt&month=200 4-01
          > main.php?dir=as phalt&month=200 3-12
          > etc.[/color]

          ok, if I do this, does anyone have an idea how to dynamically add the
          end variable to the end of every href? there are a lot of links and
          to be able to append that variable to the end of it would be the
          easiest.

          Comment

          Working...