Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Right now my rewrite rule forwards all subdomains except to the root:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*\.auricle\.fm [NC]
RewriteRule ^(.*)$$1 [L,R=301]

How can I change it so that it forwards all subdomains except for

share|improve this question

1 Answer 1

I've almost never done any apache configuration, but it took me 2 minutes to find this:

By default successive RewriteCond directives are linked by a logical AND. There is an optional modifier, [OR], that allows you to chain the next RewriteCond with a logical OR.

This should do the trick:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*\.auricle\.fm [NC]
RewriteCond %{HTTP_HOST} ! [NC]
RewriteRule ^(.*)$$1 [L,R=301]
share|improve this answer

Your Answer


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.