[thelist] mod_rewrite redirection question

Jackson Yee jyee at vt.edu
Mon Feb 24 19:03:00 CST 2003

"Edward George" <ed at suppose.co.uk> wrote in message
news:000201c2dc00$a01d9840$9200a8c0 at dirtyape...
> A question about mod_rewrite on Apache1.3(linux) with rewrite rules
> applied in the virtual hosts configuration:
> I'm trying to rewrite a url ...co.uk/search?q=search_term (generated by
> a html get form) to
> ...co.uk/search/search_term

mod_rewrite doesn't like to match query strings on the left side of a
RewriteRule.  Try a rewritecond rule and see if this might work for you:

RewriteCond %{QUERY_STRING} q=(.*)
RewriteRule ^search$ /search/%1 [R]

Of course, I haven't tested this yet, but it might be a good place to start
even if it doesn't work out for you.

Jackson Yee
jyee at vt.edu

More information about the thelist mailing list