mod-rewriteiirf

mod_rewrite with multiple variables


I have a URL like so:

http://localhost/deals/?search=fred that redirects to index.cfm?path=

When I use mod rewrite the URL parameter becomes

path = /deals/?search=fred

I currently have RewriteRule /(.*) /index.cfm?path=/$1 [L]

How can I split it so I can actually use the URL variable "search"?

I am using IIRF rewrite.


Solution

  • This fixed my problem.

    thanks

    RewriteCond %{QUERY_STRING} ^$
    RewriteRule ^/(.*)$ /index.cfm?path=$1 [L]
    RewriteRule ^/(.*)\?(.*)$ /index.cfm?path=$1&$2 [L]