Yoom Nguyen wrote:
I have this rewrite rule implemented and it will work fine if I access to Apache
web server directly.   But, if the traffic route to a load balancer (F5) then 
to the Apache server
it won't work. The browser will trying to open the maintenance.html page and nothing will display and it won't give any error either.

Here is what the load balancer F5 does, F5 perform a https server for the 
Apache server.
So any traffic reply from Apache on port 80 will be display on port 443 on the 
end user's browser.


It's a little unclear on what ports you are actually using (you mention port 80 and 443). Is the end user's browser requesting an http or an https page? If they are requesting an https page but apache is serving it as an http page, are you sure the load balancer can actually rewrite it as an https request to pass along to the end user? Does the load balancer handle all of the SSL encryption/decryption work to allow it to "talk" to apache over http?

The rewrite rules below are port agnostic, meaning if the client (end user or load balancer) make a request on port 80, it will remain on port 80. The same goes for port 443, so you shouldn't require anything special in the rewrite rules to accommodate for http versus https.

You might want to put the RewriteCond directive directly above RewriteRule, for better readability.

--
Justin Pasher

Is there a way to change the RewriteCond or RewriteRule to accommodate the 
Https issues???




The below syntax was recommended by Eric Covener? and it works for going direct to Apache but not going through the F5 load balancer.

       DocumentRoot /srv/www/maintenance/

        # Rewrite Rules
        RewriteEngine on
        RewriteCond %{REQUEST_URI} !=/maintenance.html

# Apache log files and location
        ErrorLog /var/log/apache2/maintenance.error_log
        CustomLog /var/log/apache2/maintenance.access_log combined

        # Redirect rule
        RewriteRule ^(.*)$ /maintenance.html [R=302,NC,L]

#########  Local server landing page #########################
        <Directory "/srv/www/maintenance/">
        Options None
        Order allow,deny
        Allow from all
        </Directory>


Thanks much,

Y

---------------------------------------------------------------------
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: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to