Solved

.htaccess to 'CLOSE' my website

Posted on 2003-11-18
1
218 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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