mod rewrite rule for re-directing old pages

Discussion in 'Google' started by gamma, Mar 19, 2007.

  1. #1
    Hi, I have an old site that used to have static html pages. After updating, I created rewrite rules in .htaccess to redirect the old urls to dynamic pages. For example:

    RewriteRule ^products/([-_A-Za-z0-9]+).html$ products.php?filekey=$1.html

    Does this rule look ok from a SEO perspective? Will the spiders be able to detect the redirect? (since its preserving the old url I thought not..)

    Site in question has dropped in ranks a few months after the update, so I'm trying to rule out any possible side effects from the redirects.

    Thanks!
     
    gamma, Mar 19, 2007 IP
  2. gravis

    gravis Peon

    Messages:
    145
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteRule ^products/([-_A-Za-z0-9]+).html$ products.php?filekey=$1.html [R=301,L]

    That will tell the SEs that your page has now moved to the new location. Simply redirecting does not make any diff since SEs still try to access your old pages.
    Hope this helps!
     
    gravis, Mar 19, 2007 IP
    Guardian likes this.
  3. gamma

    gamma Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks gravis. Actually the point of the rewrite (in this case) is to keep the URL the same, so to the spiders (and humans) they shold hopefully see no difference, even though they are now being served a dynamic page.

    Do you still think I should add 301s?
     
    gamma, Mar 19, 2007 IP
  4. gravis

    gravis Peon

    Messages:
    145
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    301 - permanent redirect. Using 301 will tell the Search Engines that the old page is no longer there and it is now replaced with a new page. In future, when you see that your old pages are gone from search engines, you can safely remove the redirect. Otherwise, the SEs will continue to keep those old pages in their listing for a very long time and whatever you do with your new pages will take longer time to reflect in SE results.
     
    gravis, Mar 19, 2007 IP
  5. gamma

    gamma Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just to clarify - The old and new page are the same url. Mod-rewrite is allowing the new page to be dynamically generated behind the scenes, preserving the old url.
     
    gamma, Mar 19, 2007 IP
  6. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #6
    if you want se spiders to find those pages , you must use 301 redirect (permanent redirect).
     
    trichnosis, Mar 20, 2007 IP
  7. gamma

    gamma Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The urls haven't changed! lol
    thanks anyway
     
    gamma, Mar 20, 2007 IP
  8. gravis

    gravis Peon

    Messages:
    145
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If old the new URLs are same why would you need redirectors?
     
    gravis, Mar 20, 2007 IP
  9. gamma

    gamma Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    the redirect is internal, so that the old url (static) can display a dynamic generated page as outlined in the first post.
     
    gamma, Mar 20, 2007 IP
  10. gravis

    gravis Peon

    Messages:
    145
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Great! In that case you don't need 301 at all. Going back to your original question - No, spiders won't be able to detect your internal rewriting :)
     
    gravis, Mar 21, 2007 IP
  11. gamma

    gamma Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    ok thanx g! :D
     
    gamma, Mar 21, 2007 IP