Require rewrite rule for maintaince page

Hello, I am using below ReWrite rule to get the maintainence page whenever there is file named maintenance_mode in the DOCUMENT_ROOT. It works fine but I any reference to "a href" for img and css doesn't work and all of them is getting forwarded to /sitedown.html. Appreicate if someone can help in fixing it. Thanks!

RewriteCond %{DOCUMENT_ROOT}/maintenance_mode -f
RewriteRule ^.*$    /sitedown.html [L]

Open in new window

beer9Asked:
Who is Participating?
 
Steve BinkCommented:
Add an exclusion for sitedown.html as shown:
RewriteCond %{DOCUMENT_ROOT}/maintenance_mode -f
RewriteCond %{REQUEST_URI} !^/?sitedown\.html$
RewriteRule ^\.html?$    /sitedown.html [L]

Open in new window

0
 
Steve BinkCommented:
Change your ruleset as follows:
RewriteCond %{DOCUMENT_ROOT}/maintenance_mode -f
RewriteRule ^\.html?$    /sitedown.html [L]

Open in new window

0
 
beer9Author Commented:
I am getting a redirection loop because of above
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.