Concatenating RewriteCond

Apache HTTPDIf you want to concatenate RewriteCond with logical AND it is enough to put them one under the other view:

Convert url to lower case using Apache HTTP

If you want to concatenate them with a logical OR then we must use the [OR] operator. For example, if we have the domains:

and we want to redirect the domains and we would to in the following way:

RewriteCond % {%{HTTP_HOST}$ [OR]
RewriteCond % {%{HTTP_HOST}$
RewriteRule ^ /(.*) $$ 1 [L,NE,NC]

Recommended reading

Mod_rewrite module

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.