You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Dean Gaudet <dg...@arctic.org> on 1997/08/01 05:29:45 UTC

Re: documentation/948: ServerPath doesn't work as excpected from the documentation.

I don't have the time to walk the user through this at all.  Should anyone
want to work out the full solution, you pretty much have to use
mod_rewrite. 

All stuff for www.foo.dom should have /www.foo.dom/ at the beginning of
the URL.  If a request from a Host:-client comes in to www.foo.dom, it
should be redirected to http://www.foo.dom/www.foo.dom/. 

RewriteRule ^/www.foo.dom	-		[L]
RewriteRule ^(.*)		/www.foo.dom$1	[L]

In this way you ensure that all valid urls for the site have /www.foo.dom
in them.  The rest is trivial.

Dean

On Thu, 31 Jul 1997, Sebastian Andersson wrote:

> 
> >Number:         948
> >Category:       documentation
> >Synopsis:       ServerPath doesn't work as excpected from the documentation.
> >Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    apache (Apache HTTP Project)
> >State:          open
> >Class:          change-request
> >Submitter-Id:   apache
> >Arrival-Date:   Thu Jul 31 03:50:01 1997
> >Originator:     sa@hogia.net
> >Organization:
> apache
> >Release:        1.1.1 and newer
> >Environment:
> RedHat  linux 4.2
> >Description:
> If one creates a IP less virtual host and adds a ServerPath /www.domain.com
> so old clients should be able to use http://www.domain.com/www.domain.com
> then (at least I) one can expect from the documentation that an old client's
> request of the form http://www.domain.com/www.domain.com/X and a new client's
> http://www.domain.com/X should be equal but this isn't true it seems. If
> the virtualdomain entry contains ScriptAlias /cgi-bin /home/user/cgi-bin and
> DocumentRoot /home/user/www then
> http://www.domain.com/www.domain.com/cgi-bin/test.cgi doesn't work for an old
> client but http://www.domain.com/cgi-bin/test.cgi works for a new client.
> 
> When I inspect my custom log I see that the virtual domain is correct 
> (test.hogia.net) but it says that the user was accessing /test.hogia.net/
> when an old client tried: http://test.hogia.net/test.hogia.net/
> 
> What should I do to make this work correctly? Use mod_redirect somehow to rewrite
> test.hogia.net/ into / for clients that don't set the Host header?
> Would that fix the logfiles as well?
> 
> Here is my entry:
> <VirtualHost test.hogia.net>
> User sa
> Group staff
> ServerAdmin sa@hogia.net
> DocumentRoot /home/sa/html
> ServerName test.hogia.net
> ServerPath /test.hogia.net
> CustomLog /home/sa/logs/test.custom "%v %h %l %u %t \"%r\" %s %b"
> ScriptAlias /cgi-bin/ /home/sa/cgi-bin/
> Alias /error_htmls /etc/httpd/htdocs/error_htmls
> </VirtualHost>
> >How-To-Repeat:
> http://test.hogia.net/test.hogia.net/ is basically the same as the above
> but without User and Group most of the time. There is a cgi-bin/test.cgi
> script there as well.
> >Fix:
> Either update the documentation or (better) fix the code so the server path
> part is removed from the URL
> >Audit-Trail:
> >Unformatted:
> 
> 
>