MyBB Community Forums

Full Version: how to shutdown the forum with .htaccess?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Tried that
Tried it without an ip, i.e. deny everyone
restarted apache
replaced htaccess file
no matter what i do my forum is always accessible
It might be your cache issue, try clearing caches.
No that dunt seem to be the issue.
I have accessed my forum from a pc that has never even been on the net untill I built it.
For the MyBB 1.4 -> MyBB 1.6 update I used this:


# Maintenance
RewriteCond %{HTTP_COOKIE} !mybbuser=1_AaBbCc
RewriteRule ^ 503.php [L]

Instead of mybbuser=1_AaBbCc you have to put your authentication cookie (at least the beginning of it) in there. This depends on your cookie prefix, user id and login secret (you can find this in your browsers list of cookies or using the webdeveloper toolbar or even by looking in the mybb db).

the 503.php then was a nice simple page that displayed an image with a sorry under maintenance notice.

<?php
@header("HTTP/1.1 503 Service Temporarily Unavailable");
@header("Status: 503 Service Temporarily Unavailable");
@header("Retry-After: 3600");
@header("Content-Type: text/html; charset=UTF-8");
?>
<html>
<head>
<title>503 Service Temporarily Unavailable</title>
</head>
<body>
Sorry, Maintenance. lalala
</body>
</html>

However for small updates I don't really bother with that. I just set the board closed, update, and open the board again.
Awesome method with cookie, way better than deny from all allow from xx.xx.xx.xx method
Thanks to @frostschutz for sharing.

I will add from myself, that on some hosts you may need to add

RewriteEngine On
RewriteBase /

betwin #maintenance line and RewriteCond
so it would looks like this

# Maintenance
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !mybbuser=1_AaBbCc
RewriteRule ^ 503.php [L]
Good work @atnun
Quote: If you don't know your IP just visit a site like www.whatismyip.com

There is a similar ip search site called IP-Details.com to check our External ip address. Here it display IP address, ISP, Location, Country and so on,...
Pages: 1 2