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:

-flossblog.ca
-flossblog.co.uk
-flossblog.com
-flossblog.es
-flossblog.de

and we want to redirect the domains flossblog.ca and we would flossblog.co.uk to flossblog.com in the following way:

RewriteCond % {%{HTTP_HOST} flossblog.ca$ [OR]
RewriteCond % {%{HTTP_HOST} flossblog.co.uk$
RewriteRule ^ /(.*) $ http://www.flossblog.com/$ 1 [L,NE,NC]

Recommended reading

-Mod_rewrite module

The tutorials here on LibreByte are provided under a free software licence. if you like my work you should consider:
Buy a Hosting/VPS or Dedicated Server at MCKHost

Leave a Reply

Your email address will not be published.

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