httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Campos" <rodr...@geekbunker.org>
Subject Re: [users@httpd] help with URL redirection
Date Tue, 03 Sep 2002 18:53:57 GMT
It can be accomplished with mod_rewrite:

RewriteCond %{REQUEST_URI} ^/([^/]+)/?$
RewriteCond /documentroot/%1 !-d [NC]
RewriteRule /.* http://calendar.domain.com/view.php?ID=%1 [R,L]


Your mileage may vary, but this should work ;)

--
Rodrigo Albani de Campos
http://geekbunker.org/rodrigo/?sig

Eat Healthy
Stay Fit
Die Anyway

----- Original Message -----
From: "Chad Day" <cday@atpco.com>
To: <users@httpd.apache.org>
Sent: Tuesday, September 03, 2002 3:11 PM
Subject: [users@httpd] help with URL redirection


> I can't seem to figure out how to write this rule..
>
> I want requests going to http://calendar.domain.com/username to be
> automatically forwarded to
http://calendar.domain.com/view.php?ID=username.
> The catch is I only want to forward requests when the username part is
404,
> so when users try to access normal pages at calendar.domain.com, they come
> up directly and aren't forwarded via the rule.  So, I need a rule to
detect
> if the page is 404, and instead of showing an error page, redirect them to
> the view.php page.  Or am I just better off building in some sort of
> autoforwarder for all 404 pages served on calendar.domain.com?
>
> Thanks,
> Chad
>
>
> ---------------------------------------------------------------------
> 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