Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following configuration in an Apache configuration file for a CGI script:

RewriteEngine on
RewriteCond %{QUERY_STRING} !^/var/log/syslog-ng/JBoss.*$
RewriteRule ^/cgi-bin/(.*)$ /secure-cgi-bin/$1 [R=301,L,QSA]

The idea being that if someone uses the CGI script to view a path other than ones beginning /var/log/syslog-ng/JBoss, they should be redirected through a secured CGI script instead.

I would now like to change the RewriteCond so that a second path can also be viewed without going through the secure CGI. This second path is /var/log/syslog-ng/Tomcat.

How do I go about making this change?

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

You can use multiple lines and [OR] flag like samarudge told you, but since you only have slightly different paths, here's a reminder: ReWriteCond/Rule supports regular expressions, so format like this is possible, too:

RewriteCond %{QUERY_STRING} !^/var/log/syslog-ng/(JBoss|Tomcat).*$
share|improve this answer
add comment

You should just be able to chain multiple RewriteCond with the [OR] flag

RewriteEngine on
RewriteCond %{QUERY_STRING} !^/var/log/syslog-ng/JBoss.*$ [OR]
RewriteCond %{QUERY_STRING} !^/var/log/syslog-ng/Tomcat.*$ [OR]
RewriteRule ^/cgi-bin/(.*)$ /secure-cgi-bin/$1 [R=301,L,QSA]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.