Hello.
First thing I would do would be adding the entry for 192.168.1.100 in the /etc/hosts, e.g. :
192.168.1.100 proxy1-this-is-local.loc
Then replace all appearances of 192.168.1.100 with proxy1-this-is-local.loc
Don't forget to put:
ServerName proxy1-this-is-local.loc
instead of:
ServerName 192.168.1.100
in the second virtual host.
BTW, you should have one file per virtual host in the /etc/apache2/sites-available/ . Name each virtual host according to the domain name, e.g. mydomain.com
You can enable each host by typing:
a2ensite mydomain.com
Then, try to write the Rewrite conditions like the following:
RewriteEngine On
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 9
RewriteCond %{HTTP_USER_AGENT} ^NameOfFirstBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^NameOfSecondBot [OR]
RewriteCond %{HTTP_USER_AGENT} ^NameOfThirdBot
RewriteRule ^(.*)$ http://proxy1-this-is-local.loc/$1 [P]
Notice that last rule in the RewriteCond set is not appended with logical operator [OR]
Don't forget to debug the /var/log/apache2/rewrite.log
Regards
Last edited by warez74; 04-17-2013 at 02:59 PM.
Reason: typo
|