DreamHost Web Hosting
Discussion Forum


Forums
   >> General Troubleshooting
*Threaded Mode

Subject rewrite_mod RewriteRule problem  
Posted bywiglaf (DH New User )
Posted on01/08/08 07:55 PM



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.



Subject Re: rewrite_mod RewriteRule problem new [re: wiglaf]  
Posted byAtropos7 (DH DreamNinja)
Posted on01/08/08 09:04 PM



In reply to:

rewriteRule ^(.*) /script.php?var=$1 [L]

But that returns a 500 internal error.


Iteration - From Wikipedia, the free encyclopedia



openvein.org -//- One-time $50.00 discount on DreamHost plans: Use ATROPOS7

Subject Re: rewrite_mod RewriteRule problem new [re: wiglaf]  
Posted bywiglaf (DH New User )
Posted on01/09/08 06:40 PM



RewritCond $1 !^script\.php$
RewriteRule (.*) /script.php?var=$1 [L]




*Threaded Mode
Jump to