Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    htaccess issues, deny from [..]

    Hi, I'm having trouble with deny from [...] in .htaccess, such as below:

    Code:
    # Spammers
    order deny,allow
    deny from 72.20.5.6
    deny from 94.27.74.125
    deny from 93.174.93.200
    deny from 212.117.188.139
    deny from 80.67.6.226
    deny from 212.117.188.135
    deny from 95.168.177.79
    
    <Files "settings.php">
    Order Allow,Deny
    Deny from All
    </Files>
    
    RewriteEngine on
    RewriteRule ^([0-9]+)$ index.php?$1
    RewriteRule ^latest$ index.php?p=latest
    RewriteRule ^top$ index.php?p=top
    RewriteRule ^bottom$ index.php?p=bottom
    RewriteRule ^browse$ index.php?p=browse
    RewriteRule ^random$ index.php?p=random
    RewriteRule ^random1$ index.php?p=random1
    RewriteRule ^search$ index.php?p=search
    RewriteRule ^add$ index.php?p=add
    RewriteRule ^queue$ index.php?p=queue
    Options All +Indexes
    Deny from ip seems useless, everything else works apart from the deny rules. does anyone have any suggestions as to what may be the problem?

  • #2
    New to the CF scene
    Join Date
    May 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok guys, I got it working.. for anyone else that needs to know the answer to the correction:

    Code:
    Order Allow,Deny
    Deny from 72.20.5.6
    Deny from 94.27.74.125
    Deny from 93.174.93.200
    Deny from 212.117.188.139
    Deny from 80.67.6.226
    Deny from 212.117.188.135
    Deny from 95.168.177.79
    Allow from ALL  
    
    <Files "settings.php">
    Order Allow,Deny
    Deny from All
    </Files>
    
    RewriteEngine on
    RewriteRule ^([0-9]+)$ index.php?$1
    RewriteRule ^latest$ index.php?p=latest
    RewriteRule ^top$ index.php?p=top
    RewriteRule ^bottom$ index.php?p=bottom
    RewriteRule ^browse$ index.php?p=browse
    RewriteRule ^random$ index.php?p=random
    RewriteRule ^random1$ index.php?p=random1
    RewriteRule ^search$ index.php?p=search
    RewriteRule ^add$ index.php?p=add
    RewriteRule ^queue$ index.php?p=queue

  • #3
    Regular Coder
    Join Date
    Oct 2004
    Posts
    366
    Thanks
    0
    Thanked 18 Times in 18 Posts
    You can simplify the mod_rewrite
    Code:
    Options All
    Options +FollowSymLinks +Indexes
    
    RewriteEngine On
    
    RewriteRule ^([0-9]+)$ ./index.php?$1 [QSA,L]
    RewriteRule ^(latest|top|bottom|browse|random1?|search|add|queue)$ ./index.php?p=$1 [QSA,L]


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •