0

I have an Apache 2.4 server running on Windows 2008 R2 as a reverse proxy and I wanted to be able to display a page that shows that a server (one of the virtual hosts) is down for maintenance. After searching a bit I found this solution which I added to the virtual host entry:

#Maintenance Enabled below (or comment to omit!)
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !default.htm$
RewriteRule $ default.htm [R=302,L]

The maintenance page displays but an image in the page does not. I am assuming that is because the rewrite rule isn't allowing for the jpeg. Is that the correct assumption? The page and the jpg file both reside in the document root of the server. I don't see any errors listed in the logs and when I open the page on the server itself I see the text and the jpeg properly displayed.

Do I need to add a rewrite rule so the jpg will display or is there something else going on?

0

You don't even need a RewriteCond clause if you want ALL requests to be redirected.

Here is how you'd go:

RewriteRule ^ /maintenance.htm [R=302,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.