I'm new when it comes to using rewrite_mod on apache, and I seem to be having a problem that should be easy to figure out, but I have no idea what's going on.
I'm in a directory mysite.com/ and I want to rewrite all requests for a sub-directory to a php script. So mysite.com/subdir gets rewritten to mysite.com/script.php?var=subdir
What I came up with is this (assume RewriteEngine on):
rewriteRule ^(.*) /script.php?var=$1 [L]
But that returns a 500 internal error. What's weird is if I try
rewriteRule ^test/(.*) /script.php?var=$1 [L]
and give the server a request for mysite.com/test/subdir it works. Why does it work for one and not the other? Thanks.