Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-19-2009, 04:37 PM   PM User | #1
EcKstasy
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
EcKstasy is an unknown quantity at this point
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?
EcKstasy is offline   Reply With Quote
Old 05-19-2009, 06:25 PM   PM User | #2
EcKstasy
New to the CF scene

 
Join Date: May 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
EcKstasy is an unknown quantity at this point
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
EcKstasy is offline   Reply With Quote
Old 05-20-2009, 06:24 PM   PM User | #3
schleppel
Regular Coder

 
Join Date: Oct 2004
Posts: 330
Thanks: 0
Thanked 13 Times in 13 Posts
schleppel is an unknown quantity at this point
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]
schleppel is offline   Reply With Quote
Reply

Bookmarks

Tags
.htaccess, apache2, deny, deny from, htaccess

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:41 PM.


Advertisement
Log in to turn off these ads.