MyBB Community Forums

Full Version: How do I do this in .htaccess?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to make it where only a few IPs can view my forum and everybody's IPs that are not set on that list will not be able to access the site, since we are under construction.

EDIT: forgot to add my website: http://assistforums.com/forum/
I always use:

http://www.techiecorner.com/97/redirect-...-htaccess/

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$ 
RewriteCond %{REMOTE_HOST} !^888\.888\.888\.888

RewriteRule $ /maintenance.html [R=302,L] 

and change :

888\.888\.888\.888

To your IP. To add others i think you can just copy the line and add additional IPs (though have never tried that).
I find this to be a little simpler, but there's tons of ways to do it. This way will show a 403 Forbidden to everyone but you.

Order Deny,Allow
Deny from all
Allow from your.ip.address 
(2012-10-29, 03:10 AM)pandaa Wrote: [ -> ]I find this to be a little simpler, but there's tons of ways to do it. This way will show a 403 Forbidden to everyone but you.

Order Deny,Allow
Deny from all
Allow from your.ip.address 

Thank you very much, but what if I want to add multiple IPs?
EDIT: I input the code, launched tor and I could still access it.
http://whatsmyip.org

Put *that* IP Address in, and you should be able to access it.
(2012-10-29, 05:12 AM)bcousins Wrote: [ -> ]http://whatsmyip.org

Put *that* IP Address in, and you should be able to access it.

I know that, but what i'm saying is I opened up TOR to see if the code was working, but I could still access it on an ip that was not on that list.
Does your server allow .htaccess?
(2012-10-29, 07:20 PM)Ben Cousins Wrote: [ -> ]Does your server allow .htaccess?

I would hope so, we have hosting24 and i'm not too familiar with their hosting.
(2012-10-29, 03:10 AM)pandaa Wrote: [ -> ]I find this to be a little simpler, but there's tons of ways to do it. This way will show a 403 Forbidden to everyone but you.

Order Deny,Allow
Deny from all
Allow from your.ip.address 

it might be simpler but it is not cleaner. the other way also puts the user onto a page that explains (once you create it) that you are down and also returns a 302 error (temp unavailable) for the search engines. the "simple" way dumps a 503 not allowed error for everyone