I am trying to produce a regex for apache which will ignore certain strings, and can use other things. Ive attempted a variety of techniques however cannot appear to have it correct.

for instance

i would like it to ignore


but other things i would like it to use


If you prefer a regex that suits whatever.mysite.com where whatever is any possible hostname, however, you want the regex to not match ignore.mysite.com, then do this:


The secret is by using negative lookahead.

If you would like this regular expressions for mod_rewrite, you should use RewriteCond with negation, much like this:

   RewriteCond %{REMOTE_HOST}  !^ignore.example.com$
   RewriteRule ....

You'll find more, obviously, in documentation.