htaccess help

Discussion in 'Apache' started by Sanzbar, Mar 22, 2006.

  1. #1
    Hey guys,

    How would I rewrite a specific page to a different domain...I've tried this, but it isn't working:


    RewriteEngine On

    RewriteRule ^/forums/posting.php?mode=topicreview&t=350$ http://www.example.net/
     
    Sanzbar, Mar 22, 2006 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just do a redirect:
    redirect 301 /forums/posting.php?mode=topicreview&t=350 http://www.example.net/
    
    Code (markup):
     
    exam, Mar 22, 2006 IP
  3. Sanzbar

    Sanzbar Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    it works for just /forums/posting.php

    but when you add the "?mode=topicreview&t=350" it throws it off for some reason...any thoughts?
     
    Sanzbar, Mar 22, 2006 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^forums/posting.php?mode=topicreview&t=350$ http://www.example.net/ [R=301,L]
     
    Nintendo, Mar 22, 2006 IP
  5. Sanzbar

    Sanzbar Peon

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Doesn't seem to be working...which folder would I need it in? The main or the forum folder? I've got it in the main...
     
    Sanzbar, Mar 22, 2006 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    domain.com/.htaccess

    for

    domain.com/forums/posting.php?mode=topicreview&t=350
     
    Nintendo, Mar 22, 2006 IP
  7. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Did you try escaping the . and ? in the URL?
    redirect 301 /forums/posting\.php\?mode=topicreview&t=350 http://www.example.net/
    Code (markup):
    or
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^forums/posting\.php\?mode=topicreview&t=350$ http://www.example.net/ [R=301,L]
    Code (markup):
     
    exam, Mar 23, 2006 IP