Hey all, I want to use the mod_rewrite to allow any URL *except*: http://localhost/foo/ http://localhost/bar/ ie, this would be allowed: http://localhost/hello_world/ The rule I have used is a little complictated. I think it is correct because I've used a regexp test applet and it comes up fine: RewriteRule ^((?!foo|bar).)*/$ /home/main.htm I'm getting a 500 Internal Server error. I can't think what is wrong. Any ideas? Many thanks, Matt
This code will redirect urls that start with /foo or /bar to /home/main.htm RewriteEngine On RewriteRule ^/(foo|bar)(/.*)?$ /home/main.htm [L] Code (markup):