Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fine-tuning .htaccess

Status
Not open for further replies.

vegomatic

IS-IT--Management
Aug 22, 2008
20
US
First, thanks for your help setting up my .htaccess file; it's working really well.
Now that it's up and running, I need to fine-tune it a little. What I need to do is allow access to MOST of a block of address, but deny just a couple. My file looks like this:
order deny,allow
deny from all
allow from 123.45.678.
allow from {a bunch of other individual IPs}

So what I now need to do is deny from 123.45.678.44, 123.45.678.62, 123.45.678.91, 123.45.678.104.

My questions is where do I put my "deny" lines? Before allowing the rest of the block? After allowing the rest of the block? Can I even do it this way?

Thanks in advance!


 
I think you want to use "order allow,deny" so you can say:

order allow,deny
allow from 123.45.678.0/24
allow from {the rest}
deny from 123.45.678.44 123.45.678.62 123.45.678.91 123.45.678.104

It evaluages all the allows, and if it is not denied it succeeds.

(The deny from all is implicit)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top