SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    301/302 Redirect w/ URL Parameters

    I have a number of blog articles that are still indexed but the title changed resulting in a 404 error on my site. I have installed plugin's and done some standard 301/302 redirects but I am realizing I could do some optimization if I were to parse the incoming request for categorical redirects if the current site is no longer relavant.

    For example, Google links to mysite.com/some-article/googlequery=cars.

    I would like to take that mysite.com/some-article/googlequery=cars, parse 'cars', lookup one of my sites for cars from a db, then 301/302 to mycarsite.com/googlequery=cars. All this without losing the Google referer.

    Real life example would be, Google for "sitepoint php", click http://www.google.com/url?sa=t&rct=j...uXz2zbp9ahEamA, parse out the q=sitepoint%20php, lookup another one of my sites for php, 301 to phpsite.com/q=sitepoint php, show the proper Google referer.

    Maybe someone has a better idea than using a 301/302. My primary goal is to make sure the Google referers are passed correctly and the appropriate site type is shown for the query.

  2. #2
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess maybe it isnt possible.

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    ...but Google isn't the referrer in the subsequent redirect.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •