I am trying to setup mod proxy to bar all traffic except to some specific domain. I'm able to configure it to bar individual domain names while using ProxyBlock directive, and that i can block everything using ProxyBlock *. It is possible to method to block everything only one domain?

Thanks,

-Andrew

Try:

ProxyBlock *
ProxyPass <path> <destination>

Find out if that actually works.

EDIT: scratch that. I believe you need to get creative here with mod_rewrite (the fundamental reference reaches http://httpd.apache.org/docs/current/rewrite/proxy.html):

RewriteCond  %{HTTP_HOST}    =allowtoproxy.com
RewriteRule  ^/(.*)$         http://proxytarget.com/$1 [P]
ProxyPassReverse / http://proxytarget.com/

Try that?

Do this!

RewriteEngine On
# Testing URLs
RewriteCond %{HTTP_HOST} !google.co.uk [NC]
RewriteCond %{HTTP_HOST} !bbc.co.uk [NC]
RewriteCond %{HTTP_HOST} !amazon.com [NC]
RewriteCond %{HTTP_HOST} !centos.org [NC]
RewriteCond %{HTTP_HOST} !opensuse.org [NC]
# Url to redirect to if not in allowed list
RewriteRule (.*) http://example.org/notallowed.htm