Need some help with a new rewrite

Discussion in 'Apache' started by smitts, Feb 14, 2007.

  1. #1
    I am attempting to do a fairly complex rewrite...

    I have a form that submits to "test.php" with a format as below:
    test.php?st%5B%5D=All&pricechange=&minprice=&orderby=&deals=&available=&cat%5B%5D=&time=&percentchange=&maxprice=&ss=

    I would like this page to redirect to a page somewhat like

    test-$1-$2-$3-$4-$5-$6-$7...

    which would display the content on test.php


    Does anyone have an example .htaccess that performs something similar that I can take a look at or any details of how this could be done?

    Thanks!
    Smitts
     
    smitts, Feb 14, 2007 IP
  2. smitts

    smitts Peon

    Messages:
    177
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rewritecond %{query_string} ^st%5B%5D=([a-z0-9]*)()()()()&pricechange=([a-z0-9]*)&minprice=([a-z0-9]*)&orderby=([a-z0-9]*)0&deals=([a-z0-9]*)&available=([a-z0-9]*)&cat%5B%5D=([a-z0-9]*)()()()()&time=([a-z0-9]*)&percentchange=([a-z0-9]*)&maxprice=([a-z0-9]*)&ss=([a-z0-9]*)$ [NC]
    RewriteRule ^.*$ /%19/deals/%11-%12-%13-%14-%15-%1-%2-%3-%4-%5-%6-%7-%8-%9-%10-%16-%17-%18 [R=301]
    RewriteRule ^/([^/]*)/?$ /dsAdvSearch.php?st=$1 [L]

    this kind of worked... the problem now is that there are over 10 captures so it's reading it as (%1)1 instead of %11
     
    smitts, Feb 15, 2007 IP