Remortgages - Singapore Shopping Guide - Credit Card Consolidation - Cheap Magazine Subscriptions - Mortgage Calculator

PDA

View Full Version : Quick RewriteCond help


decepti0n
Feb 2nd 2008, 3:34 pm
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(forum|images) [NC]
RewriteRule ^(.*)$ core.php

I want to redirect everything to core.php, unless it is in a few different directories (in this case forum/ or images/), but that doesn't seem to work

In other words,

/f/f/f -> core.php
/foru2m/index -> core.php
/forum/index.php -> stays normal
/images/image.png -> stays normal

Thanks for any help

joebert
Feb 3rd 2008, 10:55 pm
RewriteCond %{REQUEST_URI} !^/(forum|images) [NC]

I believe REQUEST_URI will begin with a forward slash.

decepti0n
Feb 4th 2008, 5:45 pm
It does, and I tried adding the slash but that didn't work either

Cybernaut
Feb 9th 2008, 5:10 pm
Don't create a loop. Rewrite process keeps repeating itself until no RewriteCond matches or process is stopped explicitly by L flag.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(forum|images) [NC]
RewriteRule ^(.*)$ /core.php [L]