orange08 Posted October 23, 2009 Share Posted October 23, 2009 i get a tutorial, saying the following code can put our site offline, and only the developer can view the site RewriteEngine On RewriteBase / RewriteCond %{REMOTE_ADDR} ^111\.222\.333\.444$ RewriteCond %{REQUEST_URI} !^/maintenance\.php$ RewriteRule ^(.*)$ /maintenance.php [L] for the mentioned purpose, is that replace this line RewriteCond %{REMOTE_ADDR} ^111\.222\.333\.444$ with the developer ip address? then, how to replace our ip in this line: ^111\.222\.333\.444$ still need to put ^ \. and $ can give example in putting an ip address in this line? thx! Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/ Share on other sites More sharing options...
jon23d Posted October 23, 2009 Share Posted October 23, 2009 I believe this is backwards, don't you want to send only if the IP is NOT whatever you have? Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942622 Share on other sites More sharing options...
orange08 Posted October 23, 2009 Author Share Posted October 23, 2009 I believe this is backwards, don't you want to send only if the IP is NOT whatever you have? sorry, i can't get what you meant here. mind to explain your question again? Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942626 Share on other sites More sharing options...
orange08 Posted October 23, 2009 Author Share Posted October 23, 2009 or how can i make my site only viewable by myself but others cannot access(a maintenance page instead display for them)? Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942639 Share on other sites More sharing options...
cags Posted October 23, 2009 Share Posted October 23, 2009 Try reading this... http://phpacademy.info/forum/viewtopic.php?f=31&t=955 Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942778 Share on other sites More sharing options...
purpleshadez Posted October 23, 2009 Share Posted October 23, 2009 Try reading this... http://phpacademy.info/forum/viewtopic.php?f=31&t=955 Nice tutorial and something I never considered. I use access levels on most of my projects but this is much simpler Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942785 Share on other sites More sharing options...
cags Posted October 23, 2009 Share Posted October 23, 2009 It's probably not perfect as it's the first thing I ever attempted with a .htaccess file. But it works Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942789 Share on other sites More sharing options...
salathe Posted October 23, 2009 Share Posted October 23, 2009 Remember to send out a 503 Service Unavailable header with an appropriate Retry-After time. Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942797 Share on other sites More sharing options...
cags Posted October 23, 2009 Share Posted October 23, 2009 Hello again salathe... Sending those headers never occurred to me, would this be correct (for an hour)? header('HTTP/1.1 503 Service Unavailable'); header('Retry-After: 3600'); Quote Link to comment https://forums.phpfreaks.com/topic/178697-close-site-for-maintenance/#findComment-942803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.