httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif W" <warp-...@usa.net>
Subject Re: [users@httpd] RewriteRule - works for /~user/ but not /user/
Date Tue, 28 Oct 2003 17:17:02 GMT
----- Original Message ----- 
From: "Dave [Hawk-Systems]" <dave@hawk-systems.com>
To: <users@httpd.apache.org>
Sent: Tuesday, October 28, 2003 9:50 AM
Subject: [users@httpd] RewriteRule - works for /~user/ but not /user/


> have a domain name just for user personal sites.
> mod_userdir makes "sites.mydomain.com/~username" work just fine.
> user homedirs are in the /www/vhosts/username
> mod_userdir correctly pushes ~user into the user public_html directory
> UserDir public_html
> /www/vhosts/username/public_html
>
> want to provide similar functionality to "sites.mydomain.com/username".

See http://httpd.apache.org/docs-2.0/urlmapping.html#user .

The purpose of the tilde (~) is to distinguish between a regular directory
or file under the document root, and a user directory.  You can't just
remove the tilde and expect Apache to automatically know the differrence.  I
see you attempted to compensate for this with a RewriteRule, but that
rewrites the URI sent to the browser, not the filesystem path where files
are read from (if I understand it correctly, still new to rewrite).  You'll
need to replace the tilde with something.  The example shows the usage of an
AliasMatch, which is keyed off of a /upages directory instead of a tilde.

Leif

> using the below RewriteRule ends up dumping me in the /www directory
though
>     RewriteRule ^/([a-z0-9A-Z\.\-]+)(.*) /www/vhosts/$1/public_html/$2
>
> excerpt from httpd.conf
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> .
> .
> RewriteEngine on
> .
> .
> .
> <VirtualHost 192.168.1.1>
>     DocumentRoot /www
>     ServerName webserver.mydomain.com
>     ServerAlias sites.mydomain.com
>     RewriteRule ^/([a-z0-9A-Z\.\-]+)(.*) /www/vhosts/$1/public_html/$2
> </VirtualHost>
> .
> .
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> comments appreciated.
>
> Dave
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message