301 permanent redirect with parameters

Discussion in 'Apache' started by privadous, Feb 3, 2008.

  1. #1
    I have a lot of duplicated pages with parameters because an anarchic short´s url methodology:

    real urls:
    http://mydomain/forum?action=viewthread&id=5665
    http://mydomain/forum?action=viewthread&id=5665&post=12

    old url´s:
    http://mydomain/forum-id5665.html
    http://mydomain/forum-id5665-post12.html

    new url´s:
    http://mydomain/travelforum-id5665.html
    http://mydomain/travelforum-id5665-post12.html
    and so on...

    I want to permanent redirect (301) old urls to new url´s
    but the problem is that they have prameters
    How can I do this?

    thanks a lot
     
    privadous, Feb 3, 2008 IP
  2. privadous

    privadous Active Member

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #2
    There is no way to do this?
     
    privadous, Feb 4, 2008 IP
  3. evilgreenmonkey

    evilgreenmonkey Peon

    Messages:
    26
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you post the contents of your current .htaccess file? It should just be a case of adding the extra "travel" keyword into it.
     
    evilgreenmonkey, Feb 5, 2008 IP
  4. privadous

    privadous Active Member

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #4
    privadous, Feb 12, 2008 IP
  5. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    RedirectMatch 301 ^/forum\-(.*)\.html$ http://domain.com/travelforum-$1.html
    RedirectMatch 301 ^/forum\-(.*)\-(.*)\.html$ http://domain.com/travelforum-$1-$2.html
    Code (markup):
    Tell me if it works.
     
    kulinar, Feb 25, 2008 IP
  6. privadous

    privadous Active Member

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #6
    it doesn´t recognize the rule, error 404 Not Found
    thank you anyway
     
    privadous, Feb 26, 2008 IP