Thread: Virtual Hosting
View Single Post

  #1 (permalink)  
Old 05-07-2008
souporpower@gmail.com
 
Posts: n/a
Default Virtual Hosting

Hi All

I need help with virtual hosting. I looked up the Apache VH page and
the cases presented there don't apply to me. So please bear with me.

I have a host that gets accessed in 3 different ways:

domain name: www.testdomain.com
internal DNS: ourproxy
IP: 192.168.10.1

I want to forward a request for the resource ES if the request came
from intranet only, i.e. using internal DNS or IP. That is:

http://ourproxy/ES
http://192.168.10.1/ES

are OK

http://www.testdomain.com/ES

is not OK

I tried:

<VirtualHost ourproxy:80 192.168.10.1:80>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule ^.*$ https://www.testdomain.com/ES [L]

</VirtualHost>

<VirtualHost www.testdomain.com:80>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule http://www.testdomain.com/index.html [L]
</VirtualHost>

<VirtualHost ourproxy:443 192.168.10.1:443>
RewriteCond %{REQUEST_URI} ^/ES/$
RewriteRule ^.*$ https://www.testdomain.com/dostuff [L]

</VirtualHost>

NameVirtualHost ourproxy:80
NameVirtualHost ourproxy:443
NameVirtualHost 192.168.10.1:80
NameVirtualHost 192.168.10.1:443
NameVirtualHost www.testdomain.com:80
NameVirtualHost www.testdomain.com:443

Can someone please tell me what is going wrong here?

Thanks