H all

A client of mine has recently setup an adwords campaign without my knowledge.

They have just contacted me to say that when they click the adword link, it redirects them to the 404 error page which created.

I have built the site using mod_rewrite to force all requests to the index.php and then I query the database and display content based on the URL. If no content is found in the database, I display my 404 page.

Problem is, Google's links are along the lines of:

www.mysite.com/?gclid=CMv-kavAgqUCFYxH4wod_C4

And because my database does not have a page in the database that matches that URL request, the 404 page is displayed.

has anyone used adwords before?

Do I have to capture that adword string literally and do a 301 redirect for EVERY adword campaign???

Any advice, greatly appreciated.

kbc

    I'm not very familiar with adwords, but i do have a lot of mod_rewrite time under my belt.

    Is that URL created by you or not? Is the gclid query added by google? Depending on what sort of urls your site has, it doesn't sound too hard to me to distinguish your internal mod_rewrite stuff from the google stuff.

    This all depends on what you want to do.

      hi sneakyimp

      No, that URL is generated by Google.

      In essence, my client creates hundreds of campaigns and provides the URL of a web page on his site that he wants the visitor to be redirected to when they click the Sponsored Link in Google.

      So he provideds a link as such: www.mysite.com/my-link

      But Google, in order to convert the pay-per-clicks, append their own hash references as such:

      www.mysite.com/my-link/?gclid=CMv-kavAgqUCFYxH4wod_C4

      but my site is setup to look for the last part of the URL and query the database based on that part of the URL. Now as I do not have a page that matches that URL it throws a 404 error.

      I have been building sites for years and surely Google must know they can't change URLs's of websites and still expect them to work!

      Anyway, I think im banging my head against a very big google wall.

      Cheers

        I think you'll be fine, you just need to refine your mod_rewrite rules. when you catpure the 'last part of the url', you are going to get something like my-link/?gclid=qUCFYxH4wod_C4

        I bet your mod_rewrite rule has something like (.*) to capture the 'last part of the url'.

        Try changing that to:
        code(..gclid=.*)[/code]

        This should let you capture the original url separately from the google part. If you want to post some of your rewrite rules, we might be able to refine this a bit more. Does the 'last part' include the trailing slash or not?

          Write a Reply...