Skip to content

Instantly share code, notes, and snippets.

@badcrc
Last active August 29, 2015 13:56
Show Gist options
  • Save badcrc/8977386 to your computer and use it in GitHub Desktop.
Save badcrc/8977386 to your computer and use it in GitHub Desktop.

Revisions

  1. badcrc renamed this gist May 6, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. badcrc revised this gist Feb 27, 2014. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,14 @@
    <Files wp-login.php>
    Order deny,allow
    Deny from all


    #Single IP
    SetEnvIF X-Forwarded-For "x.x.x.x" AllowIP

    #IP Range (example for a XXX.XXX.0.0/16)
    # http://stackoverflow.com/questions/17967294/how-can-i-make-a-regular-expression-for-ip-address-with-subnetmask
    SetEnvIF X-Forwarded-For "^XXX\.XXX\.(?:[0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.(?:[1-9][0-9]?|1[0-9]{2}|2[0-4][0-9]|25[0-4])$" AllowIP


    Allow from env=AllowIP
    </Files>
  3. badcrc created this gist Feb 13, 2014.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <Files wp-login.php>
    Order deny,allow
    Deny from all

    SetEnvIF X-Forwarded-For "x.x.x.x" AllowIP

    Allow from env=AllowIP
    </Files>