.htaccess 301 redirect - help me, please

Discussion in 'Programming' started by lelkoun, Jun 19, 2011.

  1. #1
    I want to redirect these URLs

    forum.tld/archive/index.php/t-1052.html
    forum.tld/archive/index.php/t-1052.html?q=randomlygeneratedstring

    to the following URL via .htaccess,

    forum.tld/threads/1052

    Does anyone know how to do that? Thanks.
     
    Last edited: Jun 19, 2011
    lelkoun, Jun 19, 2011 IP
  2. pr-seoton

    pr-seoton Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try:
    Redirect 301 /archive/index.php/t-1052.html forum.tld/threads/1052

    add http to forum.tld/threads/1052
     
    pr-seoton, Jun 20, 2011 IP
  3. lelkoun

    lelkoun Active Member

    Messages:
    288
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #3
    OK, but that number is not static, it can be anything, not just 1052. It is an ID of a thread.
     
    lelkoun, Jun 20, 2011 IP
  4. Codd

    Codd Member

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #4
    Last edited: Jun 21, 2011
    Codd, Jun 21, 2011 IP
  5. lelkoun

    lelkoun Active Member

    Messages:
    288
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #5
    Thanks. But when I open forum.tld/archive/index.php/t-1052.html?q=randomlygeneratedstring in my browser, it redirects me to forum.tld/threads/1052?s=randomlygeneratedstring. Is there a way to remove that parameter "s"?
     
    lelkoun, Jun 21, 2011 IP
  6. indianseocompany

    indianseocompany Peon

    Messages:
    204
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    For more information check out mybacklinkchecker[.]com/blog/301-redirect-for-seo/
     
    indianseocompany, Jun 24, 2011 IP