This is a discussion on Virtual Hosting within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi All I need help with virtual hosting. I looked up the Apache VH page and the cases presented there ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
On Wed, 7 May 2008 11:43:01 -0700 (PDT),
"souporpower@gmail.com" <souporpower@gmail.com> wrote: > I looked up the Apache VH page and >the cases presented there don't apply to me. Use the example as an exercise until that works. Then, start adding small changes and see where it breaks. You will see it applies more to your situation than you expected. You only need one or two NameVirtualHost directives. Not NameVirtualHost ourproxy:80 but NameVirtualHost *:80 You may have to repeat for :443 Usually, the name of the virtual host should NOT be in the <VirtualHost ....> block heading itself, but as ServerName or ServerAlias directives within each <VirtualHost *:80> </VirtualHost> or <VirtualHost *:443> </VirtualHost> block. HTH -- ( Kees ) c[_] Seminars, n.: From "semi" and "arse", hence, any half-assed discussion. (#226) |
| Thread Tools | |
| Display Modes | |
|
|