Help: Small tweak to rewrite rule

Topics: Developer Forum, User Forum
Jun 14, 2007 at 5:04 AM
Edited Jun 14, 2007 at 5:50 AM
I currently use a rule which passes everything after the url into my controller as a variable:

RewriteRule ^/(?!index.cfm)(.+)$ /index.cfm?v=$1
so basically: http://some.com/a/b/c/d = http://some.com/index.cfm?v=a/b/c/d

I like the way it works, but I need to pass in 2 variables instead of just one.
using the same example as above:
http://some.com/a/b/c/d = http://some.com/index.cfm?page=a&v=b/c/d

In addition the rule should not apply to any script in the /inc directory... (so http://some.com/inc/script.js should not be rewritten)

Is this possible?
Coordinator
Jun 14, 2007 at 10:40 PM
yes, it is possible.
how about this?

RewriteRule ^/(?!index.cfm)(?!inc)([^\?\/]*)/([^\?]+)$ /index.cfm?page=$1&v=$2 [L]