Redirect dynamic links to static

Discussion in 'Apache' started by Panjabi, Dec 30, 2008.

  1. #1
    Hi guys, I currently installed a SEO mod onto my forum, which outputs static links, however the problem is that the old (dynamic) links are not automatically redirected, is there a quick code for this?

    Below is the current .htaccess file.

    Rewriterule ^(.+)-f([0-9]*).html-(.+)$				./viewforum.php?f=$2&$3 
    Rewriterule ^(.+)-(t|p)([0-9]*).html-(.+)$			./viewtopic.php?$2=$3&$4
    Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html-(.+)$		./viewforum.php?f=$2&start=$3&$4
    Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html-(.+)$	./viewtopic.php?$2=$3&start=$4&$5
    
    Rewriterule ^(.+)-f([0-9]*).html$					./viewforum.php?f=$2&$3
    Rewriterule ^(.+)-(t|p)([0-9]*).html$				./viewtopic.php?$2=$3&$4
    Rewriterule ^(.+)-f([0-9]*)s([0-9]*).html$			./viewforum.php?f=$2&start=$3&$4
    Rewriterule ^(.+)-(t|p)([0-9]*)s([0-9]*).html$		./viewtopic.php?$2=$3&start=$4&$5
    Code (markup):
    Thanks in advance!
     
    Panjabi, Dec 30, 2008 IP
  2. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    By old links you mean already indexed ULRs, I guess. As far as I know there is no way to do that redirection, because you will get an endless loop (dynamic urls redirecting to static which redirect internally to dynamic).

    Don't worry about old URLs, they will disappear after time cause there will be no pages pointing to them. In addition, install some sitemap mod with new URLs and submit it to GWT.
     
    kulinar, Jan 3, 2009 IP