[Zope] apache rewrite virtual host URL-hiding

Kevin Carlson khcarlso@bellsouth.net
Tue, 22 Jul 2003 18:41:48 -0400


This could be something to do with the way you have defined your Virtual 
Host.  Try the following:

NameVirtualHost ip.address.goes.here

<VirtualHost ip.address.goes.here>
       ServerName openspirit.homelinux.net


If you cannot use the IP address for some reason, say you are using a 
dynamic dns server to host from a dialup account, you must use:

NameVirtualHost *

<VirtualHost *>
       ServerName openspirit.homelinux.net

If Apache does not recognize the name of the virtual host, it will 
choose the first virtual host it comes across that matches the host IP 
address.  Since you haven't specified an IP address in the latter case, 
the default virtual host will be the first one listed.

Kevin


Florian Konnertz wrote:

> Hi all,
>
> I have a porb with rewrite - after modifying httpd.conf and restarting 
> apache nothing happened so i wondered if the config was read at all... 
> but of course it may be just a fault of my rewrite rule. - Please have 
> a look:
>
> I want to do:
> http://openspirit.de should be forwarded to the zope folder "noo",
> located in (zope-root)/openspirit/noo/
> of my Zope server.
>
> I can use regular URL-forwarding, URL-hiding and rewrite-rules to 
> achieve this.  - It should be possible in some way ;)
>
> Because it didn't work that easy as i expected it tried to do it in 
> small steps, just copied my old and working virtual host entry:
>
> # current rule, works, forward von DynDNS -> IP
> <VirtualHost openspirit.homelinux.net>
>        ServerName openspirit.homelinux.net
>        ServerAlias openspirit.homelinux.net
>                RewriteEngine on
>                RewriteLogLevel 1
>                RewriteRule ^/(.*)$ 
> http://coforum.org:9080/VirtualHostBase/http/openspirit.homelinux.net:80/openspirit/VirtualHostRoot/$1 
> [P]
> </VirtualHost>
>
> # new domain: http://openspirit.de, does not work; forwarding bzw. 
> URL-hiding from a real hosting
> <VirtualHost openspirit.de>
>        ServerName openspirit.de
>        ServerAlias openspirit.de
>                RewriteEngine on
>                RewriteLogLevel 1
>                RewriteRule ^/(.*)$ 
> http://coforum.org:9080/VirtualHostBase/http/openspirit.de:80/openspirit/VirtualHostRoot/$1 
> [P]
> </VirtualHost>
>
> In both domain config menues i entered just the IP, so both adresses 
> are analogues to each other:
>
> Maybe you alreday have an idea, how to do the complete thing - i would 
> be so fair to use your solution unchanged ;-)
>
> Do i need URL-hiding in that case? IMO it's all possible with the 
> ruels and i make the domain forwarded just to the IP. I guess 
> URL-hiding is only for sites on free hosting serveices like geocities 
> and so on, right?
>
>
> Have a nice day,
>
> Florian
>
>
> P.S. What's the difference between
> <VirtualHost openspirit.de>
> und
> ServerName openspirit.de
> Why is it there twice?
>
>
>