htaccess with mod_rewrite exlusion

Associate
Joined
18 Oct 2002
Posts
1,312
Location
Milton Keynes
hey all

i am using mod_rewrite to tidy my URLS, but I want it to explude a domain so if I goto that directory it will show me the actual contents and not the dummy one.

i was using
Code:
RewriteRule ^([^/\.]+)(/)?$ index.php?view=$1 [L]

i tried
Code:
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule !^(organiser)(/.*)?$ index.php%{REQUEST_URI} [L]

but it doesnt seem to be doing what I want

any help?
 
Assuming you want it to match anything that's not in an 'organiser' directory, try this:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^!(organiser)$
RewriteRule ^!(organiser/)(.*)$ index.php/$2 [L]

(untested)
 
Last edited:
404 not found

yes i want it so when you goto /about it actually goes to /index.php?view=about

but when you goto /organiser it actually goes to /organiser/index.php like it would normally
 
Right, this should work:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/organiser/
RewriteRule ^(.*)$ index.php?view=$1 [L]
 
Back
Top Bottom