Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old November 19th, 2000, 02:20 AM
LisaH LisaH is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 11 LisaH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Below is the .htaccess file that I am having a terrible time with. To explain briefly, I have a membership site and so I need password authentication. Also, I am wanting to allow some users in if from certain IPs (in the
limit brackets).

Both of the above is no problem. The problem is when I introduce the third variable of
deny from OR rewrite engine to redirect certain remote addresses (password hurlers)
the .htaccess file ignores the RewriteEngine
towards the bottom of the file.

Can anyone help?

Thanks,

Lisa

AuthUserFile /path/to/passwords
AuthGroupFile /dev/null
AuthName "ENTER USER INFORMATION"
require valid-user
AuthType Basic

<limit GET>
require valid-user
satisfy any
order deny,allow
deny from all
allow from 194.96.59.0/24
allow from 195.5.107.0/24
allow from 195.132.176.0/24
allow from 195.252.60.0/24
allow from 202.159.84.0/25
allow from 210.126.142.64/26
allow from 216.50.193.0/25
</limit>

RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteCond %{REMOTE_ADDR} 195.23.174.185
RewriteRule /* http://www.fbi.gov [L,R]
RewriteCond %{REMOTE_ADDR} 214.123.147.78
RewriteRule /* http://www.fbi.gov [L,R]
RewriteCond %{REMOTE_ADDR} 64.110.64.164
RewriteRule /* http://www.fbi.gov [L,R]
RewriteCond %{REMOTE_ADDR} 63.15.50.47
RewriteRule /* http://www.fbi.gov [L,R]


Reply With Quote
  #2  
Old November 19th, 2000, 01:36 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
First, reorder your .htaccess:
1) Options goes first
2) Rewrite stuffs next
3) Auth stuffs last

>>RewriteCond %{REMOTE_ADDR} 195.23.174.185
>>RewriteRule /* http://www.fbi.gov [L,R]

Use this instead:
RewriteCond %{REMOTE_ADDR} ^195.23.174.185$
RewriteRule ^(.+) http://www.fbi.gov [L,R]

Don't duplicate require valid-user line

Remove the limit block

A rewrite of that section:
########################################
AuthUserFile /path/to/passwords
AuthGroupFile /dev/null
AuthName "ENTER USER INFORMATION"
require valid-user
AuthType Basic
allow from 194.96.59.0/24
allow from 195.5.107.0/24
allow from 195.132.176.0/24
allow from 195.252.60.0/24
allow from 202.159.84.0/25
allow from 210.126.142.64/26
allow from 216.50.193.0/25
satisfy any
########################################

>>RewriteBase /

This tells me your .htaccess resides in docroot dir, why are you protecting your docroot dir?

Reply With Quote
  #3  
Old November 19th, 2000, 08:58 PM
LisaH LisaH is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 11 LisaH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks freebsd. I finally realized that
I was going about it all wrong. I set up
the redirect in my home directory and the
password authentication and limit allows
inside the members directory and works like
a charm.


Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > VERY CHALLENGING HTACCESS PUZZLE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway