mod_rewrite help me rewrite this B*&#$

Discussion in 'Apache' started by noname, Mar 2, 2006.

  1. #1
    i want to rewrite
    a.com/FFqAtWork/FFqAtWork?FFqAtWork=b.com
    into
    a.com/000000A/http/b.com

    so i wrote this:

    
    rewriteengine on
    rewritecond %{query_string} FFqAtWork=(.*)
    RewriteRule ^/FFqAtWork/FFqAtWork /000000A/http/%1
    
    Code (markup):
    seems to work except
    the query string ?FFqAtWork=b.com gets readded so i end up with
    a.com/000000A/http/b.com?FFqAtWork=b.com
    i need to kill the query string.
     
    noname, Mar 2, 2006 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^000000A/http/([^.]+)\.com$ FFqAtWork/FFqAtWork?FFqAtWork=$1 [L]
     
    Nintendo, Mar 2, 2006 IP
  3. noname

    noname Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks but i want it the other way around.

    i want to give it
    a.com/FFqAtWork/FFqAtWork?FFqAtWork=b.com
    and get
    a.com/000000A/http/b.com

    my program is already url friendly. the problem is i want to make a FireFox searchplugin and what the plug in gives has url params. i want to get b.com from the query string and use it in a.com/000000A/http/b.com and no longer have a query string.
     
    noname, Mar 2, 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 ^FFqAtWork/FFqAtWork\?FFqAtWork\=([^.]+)$ 000000A/http/$1.com [L]

    It might not work with those special characters, like ?.
     
    Nintendo, Mar 2, 2006 IP