I am using Apache2 on SuSe 10 ES
My redirect rule get my webserver go into a loop.
I need to bring a production server down for a maintenance. So when this happen I want the apache server to
redirect everything from this particular production domain to a new DocumentRoot to display the MAINTENANCE.HTML page.
I basicly copy the maintenance config file into the current production vhosts.conf and copy it back when done.
Can someone point out my mistake. I can't seem to find the problem why it won't redirect correctly.
if I use the below systax the page go into a loop.
RewriteRule ^/(.*)$ maintenance.html [R=302,NC,L]
If I use this syntax below it will only work if use go to the home page. It will not work if user click on their old short cut they have on their desktop.
RewriteRule ^/$ maintenance.html [R=302,NC,L]
Here is what I have.
########################################################################
DocumentRoot /srv/www/maintenance/
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* -[F]
RewriteRule ^/(.*)$ maintenance.html [R=302,NC,L]
######### Local server landing page #########################
<Directory "/srv/www/maintenance/">
Options None
Order allow,deny
Allow from all
DirectoryIndex maintenance.html
</Directory>
Thank you,
Y