You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by St...@astrazeneca.com on 2002/01/10 11:03:12 UTC
mod_rewrite condition
Hi!
I want to use mod_rewrite to send users to a maintenance page.
I only want to do this if is maintenance going on, and without restarting
the web server.
My belief is that I have to read a "variable" outside the web server config,
because otherwise I have to restart the webserver, making it read the
changed httpd.conf files.
I tried to use a condition where it checks if there exists a named file.
That works fine and without having to restart the web server. But I'm
worried about the performance. Isn't it time-consuming to make the webserver
look for this file on every request?
Is there a better way to accomplish this?
Regards
/Stefan
---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
RE: mod_rewrite condition
Posted by Joshua Slive <jo...@slive.ca>.
> From: Stefan.Faegersten@astrazeneca.com
> Hi!
>
> I want to use mod_rewrite to send users to a maintenance page.
> I only want to do this if is maintenance going on, and without restarting
> the web server.
> My belief is that I have to read a "variable" outside the web
> server config,
> because otherwise I have to restart the webserver, making it read the
> changed httpd.conf files.
>
> I tried to use a condition where it checks if there exists a named file.
> That works fine and without having to restart the web server. But I'm
> worried about the performance. Isn't it time-consuming to make
> the webserver
> look for this file on every request?
>
> Is there a better way to accomplish this?
Well, one way to do it is to use an .htaccess that you drop into the
documentroot. But this also requires a file read on every request.
My suggestion is that you forget the "without restarting the web server"
requirement. Restarting the web server is a perfectly harmless event if you
use a "graceful" restart. No connections are lost. You can just swap in a
new config file and do a graceful restart.
Joshua.
---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org