You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chad Day <cd...@atpco.com> on 2002/09/03 20:11:48 UTC

[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


[users@httpd] how do I add PNG support to my freebsd 4.6-Stable/apache 2.0.40 test server

Posted by Rolando Morales <Ro...@TOREngineering.com>.
PNG support seems to be missing form my server. Can
someone please tell me how to add this support? My
server is using FreeBSD 4.6-Stable/ Apache 2.0.40/
PHP 4.2.3DEV.
                                    Rolando


---------------------------------------------------------------------
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] help with URL redirection

Posted by Rodrigo Campos <ro...@geekbunker.org>.
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" <cd...@atpco.com>
To: <us...@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