Solved

.htaccess to 'CLOSE' my website

Posted on 2003-11-18
1
220 Views
Last Modified: 2010-03-04
here is an extract of my .htaccess file which I use to close my website down.

This is controlled througha  PHP script which re-writes the file at the click of a link e.g. on the admin page I can click 'Close' to shut teh website down for maintenence/update etc.

=====
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !down\.php [NC]
RewriteRule ^(.+) http://something.com/error/down.php [R]
=====

However, this obviously redirects access to any page to the error document.

What I would like to do, is exclude the 'admin directory' from this redirect so that i can still login to admin to 'OPEN' the website again.

If i've been unclear just ask.

Thanks in advance
0
Comment
Question by:russelldav
1 Comment
 
LVL 17

Accepted Solution

by:
dorward earned 125 total points
ID: 9779235
Untested, but I think this will do the job

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !down\.php [NC]
RewriteCond %{REQUEST_URI} !admin$ [NC]
RewriteRule ^(.+) http://something.com/error/down.php [R]
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question