...

View Full Version : simple mod_rewrite not working.



alexv55
02-03-2011, 11:35 PM
Hello everyone,

I have been at it for two days and read apache doc, threads here and many postings . I am on a shared host and don't have access to server log/error files.

All I am trying to do is to execute test.php when someone types www.mydomain.com/wm

I have simple .htaccess setup in wm. wm is under public_html

RewriteEngine On
RewriteRule ^wm(/)?$ test.php [NC,L]

I get internal server error. What am I doing wrong.Any insight would be greatly appreciated.

Thanks.
Alex

abduraooft
02-04-2011, 08:46 AM
I get internal server error. What am I doing wrong.Any insight would be greatly appreciated. Are you sure that mod_rewrite module is On in your server? You may get some clues by checking the error_log

alexv55
02-04-2011, 05:11 PM
Thanks for the reply.

mod_rewrite was on. I got it working by changing the rule to:
RewriteRule ^(.*)$ test.php [NC,L]

My .htaccess was under directory wm, and I am concluding that rewriterule starts matching pattern on the data that exists after the directory path in which .htaccess resides.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum