Solved

.htaccess to 'CLOSE' my website

Posted on 2003-11-18
1
215 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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now