Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mod_rewrite, how do I set 2 conditions?

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

At the moment - I have:


RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|js|css|swf|png|php|cgi|pl|JPG|GIF|BMP)$
RewriteRule ^video/g-(.*).html? cgi-bin/video/page.cgi?p=$1 [L]

...but I wanna do soemthing like:


RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|js|css|swf|png|php|cgi|pl|JPG|GIF|BMP)$
RewriteCond IF FOLDER IS LIKE "wysiwyg" , THEN DONT PROCESS NEXT RULE
RewriteRule ^video/g-(.*).html? cgi-bin/video/page.cgi?p=$1 [L]

..can this be done?

TIA!

Andy
 
Hi,

Ok, I did some investigation - and found you CAN have more than one RewriteCond before a rewrite rule. I now have:

RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|js|css|swf|png|php|cgi|pl|JPG|GIF|BMP)$
RewriteCond %{REQUEST_URI} !wysiwyg$
RewriteRule ^articles/g-(.*).html? cgi-bin/articles/page.cgi?p=$1 [L]

...but this doesn't seem to work :/

Basically - I **don't** want the rule to be processed if the folder URL contains "wysiwyg"

..any suggestions?

TIA

Andy
 
By anchoring the RewriteCond with $, you are saying
if REQUEST_URI not ENDS with wysiwyg
not
if REQUEST_URI not CONTAINS wysiwyg.
 
Hi,

Yeah sorry, worked that out a while ago (forogt I posted here *blush*)

Thanks for the reply though :)

Cheers

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top