0

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.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Alessandro
  • 305
  • 2
  • 8
  • 22
  • possible duplicate of [Mod Rewrite complete befuzzlement](http://stackoverflow.com/questions/1807410/mod-rewrite-complete-befuzzlement) – outis Dec 23 '11 at 03:17

2 Answers2

1

This fixed my problem.

thanks

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/(.*)$ /index.cfm?path=$1 [L]
RewriteRule ^/(.*)\?(.*)$ /index.cfm?path=$1&$2 [L]
Alessandro
  • 305
  • 2
  • 8
  • 22
0
RewriteRule ^/(.*)/(.*)$ /index.cfm?path=$1&search=$2 [L]

However if you just wanna continue with what you use then you can simply use

RewriteRule ^/(.*)[?](.*)$ /index.cfm?path=$1?$2 [L]

OR it should be there by itself in the get variables and u can access it by something like

search = GET["search"]
Vish
  • 4,508
  • 10
  • 42
  • 74
  • hi this gets me close RewriteRule ^/(.*)/(.*)$ /index.cfm?path=$1&$2 [L] however i get ?search as a variable? – Alessandro Jul 22 '11 at 12:32
  • hi, i am not an newbie with cold fusion but i have slight idea that they should be something like how you got your path in the first place. So however you got your path, get your search like that as well. – Vish Jul 22 '11 at 12:34
  • yep sure.. thanks for your help.. it's jsut he variable becomes "?search" and to get it I need to url.?search.. which doesn't work.. I'll figure it out though.. thanks heaps :) – Alessandro Jul 22 '11 at 12:45