rewriting search query

Discussion in 'Apache' started by isd, May 5, 2008.

  1. #1
    hello, i can't get it working moderewrite in this example:

    i need to rewrite url and pass searched word to other url when clicked



    i all ready tryit many examples but nothing works for me

    could any body help me please?
    thank you very much for your help in advance
    isd
     
    isd, May 5, 2008 IP
  2. Estevan

    Estevan Peon

    Messages:
    120
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    0
    #2
    i believed this help you
    RewriteEngine on
    RewriteRule ^results?search_query=(.*) search.cgi?zoom_query=$1 [L]
     
    Estevan, May 9, 2008 IP
  3. apachehtaccess

    apachehtaccess Guest

    Messages:
    82
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Here is a more standardized approach.

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^search_query=(.+)$ [NC]
    RewriteRule ^results.*$ /search.cgi?zoom_query=%1 [QSA,L]
    Code (markup):
     
    apachehtaccess, May 9, 2008 IP
  4. isd

    isd Member

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #4
    thank you very much Estevan for your help, the first one i all ready tryit be4 with no result, the secend one i just tryit now and also have no luck...:(

    i tryit with htaccess in main directory and subdirectory
     
    isd, May 19, 2008 IP