1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.3 Htaccess question to block all IP

Discussion in 'Installation, Upgrade, and Import Support' started by Parafal, May 10, 2014.

  1. Parafal

    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.
     
  2. rainmotorsports

    rainmotorsports Well-Known Member

    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.
     
    Parafal likes this.
  3. Parafal

    Parafal Member

    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?
     
  4. Luis

    Luis Well-Known Member

    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.
     
    Parafal likes this.
  5. Parafal

    Parafal Member

    Hello Luis, thank you very much!

    I edited my htaccess with your recommendation.
     
  6. fredrikse

    fredrikse Active Member

    What do I need to add if I want the visitor to be forwarded to a maintenance page?!
     

Share This Page