Mod rewrite rule and copy content query

Discussion in 'Search Engine Optimization' started by jg_abad, Oct 15, 2007.

  1. #1
    Hello,
    if we have use rewrite rule for pages which have query string in url, for example
    pagename.php?id=123 and i have write rule such a way page name is become pagename.html,
    now, when we write this url domainname.com/pagename.php?id=123 or domainname.com/pagename.html
    same page will be open. so my doubt is, Google will consider both the page as a different one and there is a chances of duplicate content penalty.

    Looking for some suggestion for this type of situation, i think all the webmaster are using rewrite rule for dynamic pages.

    thanks
     
    jg_abad, Oct 15, 2007 IP
  2. Smaaz

    Smaaz Notable Member

    Messages:
    2,425
    Likes Received:
    160
    Best Answers:
    0
    Trophy Points:
    250
    #2
    Google will not index the page with the query string in the url if you forward it to another page. No reason to worry.
     
    Smaaz, Oct 15, 2007 IP
    jg_abad likes this.
  3. jg_abad

    jg_abad Peon

    Messages:
    903
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But one thing is there if we have put that link any where in the page and once that link will be crawled by the google they will index it. what do u think?? i m talking about link with query string.

     
    jg_abad, Oct 15, 2007 IP
  4. sweetfunny

    sweetfunny Banned

    Messages:
    5,743
    Likes Received:
    467
    Best Answers:
    0
    Trophy Points:
    0
    #4
    In your rewrite rule, add a 301 redirect to redirect all the old URL's to new ones.
     
    sweetfunny, Oct 15, 2007 IP
  5. jg_abad

    jg_abad Peon

    Messages:
    903
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i think u r not getting my question,
    i m not talking about permanent redirection, i m talking about redirect those url with query string to seo friendly name.

     
    jg_abad, Oct 15, 2007 IP
  6. sweetfunny

    sweetfunny Banned

    Messages:
    5,743
    Likes Received:
    467
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yes i know, it's exactly as i said. If you change your URL's to static, a 301 Redirect will tell Google your dynamic pages are now .html and all old links pointing to the query string URL's should be forwarded to your new .html ones.
     
    sweetfunny, Oct 15, 2007 IP
  7. jg_abad

    jg_abad Peon

    Messages:
    903
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #7
    but, if we write old link in the browser than same page will open, it this case what should we do. will google have idea that this page is redirect to .html page so no need to consider it as a copy content...
    i think u r telling this..
     
    jg_abad, Oct 15, 2007 IP
  8. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Here is one way you can do this...

    Add the following line to your htaccess file

    redirect 301 /pagename.php?id=123 /pagename.html

    This will force a 301 redirect anytime an old URL is accessed. The problem here is if you have 1000's of pages you need 1000's of 301 redirects.

    Depending on your system you might be able to do some redirecting inside your application but without more info I cant really help you there sorry :)

    ALso, go to the effort of removing any of the old links from your site.

    Hope this helps
     
    tonybogs, Oct 15, 2007 IP
  9. jg_abad

    jg_abad Peon

    Messages:
    903
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thanks for the reply, but my site is in asp.net so will it for it or not??
     
    jg_abad, Oct 15, 2007 IP
  10. sirrus

    sirrus Peon

    Messages:
    74
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    A 301 redirect will redirect any request for the dynamic page "pagename.php?id=123" to the static rewrite. If you type it in the browser window OR if Google tries to access the dynamic page, both will redirect to the static one. Google will see the redirect and consider it a replacement for the dynamic page. There will not be duplicate content.
     
    sirrus, Oct 15, 2007 IP
  11. sirrus

    sirrus Peon

    Messages:
    74
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Depending on what URL rewrite software you're using, it should work. Just check to make sure you have the write syntax.
     
    sirrus, Oct 15, 2007 IP