RewriteRule Regexp assistance

LordOfLA

Godlike!
Joined
2 Feb 2004
Messages
7,026
I got an apache rewrite rule as follows in a .htaccess file:

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

This came with drupal 6.2

Problem is this stops my invision forum working properly and totally prevents access to the admin side of things.

I need to change said rule to say basically:

"if the url matches /forum/* don't do anything, for everything else run the rule."

I've tried RewriteCond %{REQUEST_FILENAME} !^/forum/*

However that doesn't seem to work all the time. Any ideas?
 

JPRuss

OSNN Addict
Joined
5 May 2008
Messages
77
Perhaps try putting a second rewrite rule at the top of the htaccess file

RewriteRule ^/forums/(.*) /forums/$1 [L,QSA]
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

So if thie url contains /forums/ in it it should redirect to the /forms/ directory and stop processing.

I didn't get a chance to try this first, but that's the general idea
 

Members online

No members online now.

Latest profile posts

hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.
Terrahertz wrote on Electronic Punk's profile.
Yo fellas!
Electronic Punk wrote on Sazar's profile.
Where are you buddy?
Perris Calderon wrote on Electronic Punk's profile.
Hey EP! All good with me, applying for Microsoft MVP right now, should have done this a while ago.

Notifications don't work, I only found your response by coming back to hunt up some threads, if you want, give me your email address so we can keep in touch easier!

Forum statistics

Threads
61,999
Messages
673,424
Members
5,593
Latest member
moussa021