You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robert Mena <rt...@yahoo.com> on 2003/02/09 22:35:44 UTC
[users@httpd] rewriting the urls
Hi,
I'd like to configure apache so it could automatically
rewrite the urls following the pattern
user.domain.com to www.domain.com/~user
and
blog.domain.com/user to
www.domain.com/blog/blog.php?id=user
any tips / examples would be welcome :)
-rt
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
---------------------------------------------------------------------
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
Re: [users@httpd] rewriting the urls
Posted by Jurgen <ap...@squarehosting.com>.
Hi,
it should be close to this:
RewriteCond %{HTTP_HOST} ^(.+)\.domain.com$
RewriteRule ^(.+)$ http://www.domain.com/~%1/$1
I don't know if would like it all on lowercase(domain names are not case sensitive)
RewriteMap lowercase int:tolower
RewriteCond ${lowercase%{HTTP_HOST}} ^(.+)\.domain\.com$
RewriteRule ^(.+)$ http://www.domain.com/~%1/$1
The other one maybe
RewriteCond %{HTTP_HOST} ^blog\.domain\.com$
RewriteRule ^/(.+) http://www.domain.com/blog/plog.php?id=$1
If you also want the blog replaced just add do the same as in the first example.
Jurgen
On Sun, 9 Feb 2003 13:35:44 -0800 (PST)
Robert Mena <rt...@yahoo.com> wrote:
> Hi,
>
> I'd like to configure apache so it could automatically
> rewrite the urls following the pattern
>
> user.domain.com to www.domain.com/~user
>
> and
>
> blog.domain.com/user to
> www.domain.com/blog/blog.php?id=user
>
> any tips / examples would be welcome :)
>
> -rt
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> ---------------------------------------------------------------------
> 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