I have scoured the internet and am at a loss as to why my maintenance page redirect and rewrite rules do not work for any proxied material or anything that is coming across through https.
I am using an Apache 2.2.3 server with tomcat 6.0.24 installed on it.
I have the following htaccess file:
Options +FollowSymlinks
RewriteCond %{REQUEST_URI} !/maintenance.html
RewriteCond %{REQUEST_URI} !/images/(.*)$
RewriteCond %{REQUEST_URI} !/scripts/(.*)$
RewriteCond %{REQUEST_URI} !/styles/(.*)$
RewriteCond %{REMOTE_ADDR) !^123.456.789.100
RewriteRule $ /maintenance.html [R=302,L]
It redirects all of my http pages to the maintenance page and all of my images, scripts, and styles work properly. However, it is not redirecting any https pages which are proxied from another machine.
So http://mypage.com/documents
redirects to maintenance where as https://mypage.com/users
does not redirect.
Unfortunately users is a proxied service that lives on a backend server whereas documents is a static page on the front end server.
Is there a way to force proxied and/or https material to be redirected as well? Or am I able to disable mod_proxy in my htaccess file so that nothing gets proxied?
.htaccess
files (AllowOverride None
directive)..htaccess
file like plague. It's a dynamic configuration file. Rest of the configuration (in apache files) is static, makes a big difference in performances. But it's unrelated :-)On solution, if you can edit real configuration files, is to use a redirection in the VirtualHost level, not in a Directory (or .htaccess) or Location. So that it will be always applied:
I usually use a simplier form with only elements in /err subdirectory, and redirecting everything not in this subdirectory to a 503 error. The 503 is then handled by the maintenance page in this err subdirectory. Here I have added the
images/
andscripts/
subdirectories as well, did not test the expression but it should work, I think.