httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Buettner <>
Subject [users@httpd] redirect and rewriting puzzle
Date Mon, 02 Oct 2006 21:11:38 GMT
Launched a new site last week, built on Rails, Apache and mongrel.
Now have collected a number of 404 errors from the logs, and wish to 
redirect them to the appropriate page in Rails.

My situatrion is, we're using URL rewriting to direct anything that is 
not a file to the mongrel Rail balancer.  But I wish to incorporate some 
404 URLs which of course do not exist into the config.

Is there a way to write a RewriteCond such that if a URL is not 
mapped/redirected in a file, THEN do the rewrite?

My config:

   RewriteEngine On

   RewriteRule ^/(.*)$ balancer://prod_app%{REQUEST_URI} [P,QSA,L]

(which leaves Apache serving static content and mongrel doing Rails)

and later:
Include /opt/csw/apache2/etc/general_url_redirect.txt

Sample from the general_url_redirect.txt file:
RedirectPermanent   /about/eventscalendar.htm

What I'd like is to be able to do something aking to this:

   RewriteCond ^(.*)$ $1!mapped:general_url_redirect.txt

Suggestions welcomed.


Dan Buettner

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