httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] Only redirecting, but not changing the root?
Date Tue, 13 Dec 2005 08:48:17 GMT
> -----Original Message-----
> From: Lennart Aangeenbrug []
> Sent: Dienstag, 13. Dezember 2005 09:26
> To:
> Subject: [users@httpd] Only redirecting, but not changing the root?
> Hi all,
> Yesterday i've posted a question and no one replyed :-( Maybe i 
> explained it not clear enough or is it not solvable. Here is 
> my question 
> again in another words:
> How can I forward an user to a specific location, > without < 
> changing 
> the root? 

It is not clear what you mean by "the root". Do you mean the "DocumentRoot"? It's always better
to use exact keywords in technical questions rather than making up your own shorthand.

> For example:
> == goes to ==> public_html/example1/, the root stays 
> public_html/
> == goes to ==> public_html/example2/, the root stays 
> public_html/
> == goes to ==> public_html/example3/, the root stays 
> public_html/

If you do mean DocumentRoot, then I'm confused. The DocumentRoot never changes. So now I'm
beginning to think you mean the path displayed in the browser location bar... If so, you could
do something like this (untested):

- set up a default VH, possibly on localhost, which has "DocumentRoot /path/to/public_html"
- set up one name-based VH for each site which proxies (or rewrites in proxy-mode) the request
to the default server


# default VH

  DocumentRoot /path/to/public_html

# site VHs

NameVirtualHost *:80

<VirtualHost *:80>

  ProxyPass /
  ProxyPassReverse /


  RewriteRule ^/(.*)$1 [P]


repeat as required...

How it works:

- Incoming request has Hostname = so is routed to the VH with that ServerName.

- VH makes a second request to localhost with path /example1
- this request is routed to the default VH on localhost
- default VH fetches the page and returns it to example1 VH
- example1 VH passes the page back to the client

Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

> The root public_html contains nothing more than a .htaccess file. It 
> should recognize which domain is adressed and then send it to 
> the right 
> dir. Why I want this? I keep in the dir  public_html/ several other 
> dirs, like graphic & tools I need for all sites.
> gr, Lennart
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:> for more info.
> To unsubscribe, e-mail:
>    "   from the digest:
> For additional commands, e-mail:
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat keinen Bezug zur Börsen-
bzw. Geschäftstätigkeit der SWX Gruppe. This e-mail is of a private and personal nature.
It is not related to the exchange or business activities of the SWX Group. Le présent e-mail
est un message privé et personnel, sans rapport avec l'activité boursière du Groupe SWX.
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message