Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 6 Years, 11 Months, 2 Weeks ago How do I do this in .htaccess?
#1
Solved: 6 Years, 11 Months, 2 Weeks ago
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/
#2
Solved: 6 Years, 11 Months, 2 Weeks ago
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).
#3
Solved: 6 Years, 11 Months, 2 Weeks ago
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 
#4
Solved: 6 Years, 11 Months, 2 Weeks ago
(10-29-2012, 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.
#5
Solved: 6 Years, 11 Months, 2 Weeks ago
http://whatsmyip.org

Put *that* IP Address in, and you should be able to access it.
[Image: kAhpvOW.png]
#6
Solved: 6 Years, 11 Months, 2 Weeks ago
(10-29-2012, 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.
#7
Solved: 6 Years, 11 Months, 2 Weeks ago
Does your server allow .htaccess?
[Image: kAhpvOW.png]
#8
Solved: 6 Years, 11 Months, 2 Weeks ago
(10-29-2012, 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.
#9
Solved: 6 Years, 11 Months, 2 Weeks ago
(10-29-2012, 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
Lost interest, sold my sites, will browse here once in a while. It's been fun.


Forum Jump:


Users browsing this thread: 1 Guest(s)