XF 1.3 Htaccess question to block all IP

Parafal

Member
Hello,

I am doing a fresh install of my XF 1.31 and I would like to edit the htaccess that comes with XF to deny all IP except mine.

Order deny,allow
Deny from all
Allow from XXX.XXX.XXX

Is it ok if I just include this code above in the htaccess file that comes with XF 1.3.1? Or this will cause a problem during my XF instalation?

Thanks.
 
I have never done it for an install but shouldn't be an issue. I actually always put in the local host ip address just in case. You need to put it in the root htaccess file so yes if you are using the one that comes with xenforo (needed for full friendly urls) then throw it in the top of there.

Worth noting you can also do a redirect to all ips but yours instead and put up a friendly construction page or something.
 
Thanks, so just to be sure, I should include the code before:

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

So it will look like:

Order deny,allow
Deny from all
Allow from XXX.XXX.XXX
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

Is that right?
 
This is what I use
Code:
ErrorDocument 403 http://MyWeb.com/test/index.html
Order deny,allow
Deny from all
Allow from XXX.XXX.XXX.XXX
The first line is to redirect to other users to a maintenance page.
 
Back
Top Bottom