apache mod_rewrite notes

mod_rewrite directives won’t work in the main + httpd.conf + file if there are virtual hosts. the directives must go in the virtual host configurations. drove myself crazy 'til I figured that one out…

a rewrite rule to help debugging:

RewriteCond %{QUERY_STRING} !debug
RewriteRule (.*) /$1?debug&q=%{THE_REQUEST}&h=%{HTTP_HOST} [R=301,L,QSA]
R=301

do a redirect so the browser sees it

L

last rule

QSA

show the query string

then, do something like:

curl -IL 'grox.net/?q=blahblah&h=grox.net'