how can I redirect traffic of all websites (and not one of them) to a page in apache2 conf file?
the goal is creating a maintenance page for all domains.
You need to use the following rewrite rules:
This should redirect all requests to the
To easily change many vhosts, add this to all of them (you only need to do this once):
Add something like @Khaled's answer in
Create a symlink at
In your cron job, simply repoint that link at the beginning and end and give Apache a graceful restart after each one.
It might be better to do this in PHP (or whatever scripting language you use) and trigger it with a file or a database entry if you can.