.htaccess allow at directory level | Unix Linux Forums | Web Programming

  Go Back    


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

.htaccess allow at directory level

Web Programming


Tags
htaccess, script

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-30-2012
molwiko molwiko is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 1 November 2013, 8:18 AM EDT
Posts: 21
Thanks: 8
Thanked 0 Times in 0 Posts
Wrench .htaccess allow at directory level

Hi Guys

I have a web a site at the following directory
/var/www/
the website is containing a lot of sub directories.
/var/www/mywebsite/folder1
/var/www/mywebsite/folder2
/var/www/mywebsite/folder3
I would like to block all the website expect one user ex: user1 password1
who can see everything and another user who can see only folder2 ex: user2 password1


Code:
AuthType Basic
AuthName htaccess
AuthUserFile /var/www/.secret
AuthGroupFile /dev/null
#<Limit GET POST>
#order deny,allow
#deny from all
#require user Loylogic
#require user Ates
#</Limit>
require user user1
SetEnvIf Request_URI "(/var/www/mywebsite)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
require user user2
SetEnvIf Request_URI "(/var/www/mywebsite/folder1)$" allow
Order allow,deny
Allow from env=allow
Satisfy any

the issue this code doesn't work can you please help to sort to this our thanks

Last edited by Corona688; 11-30-2012 at 10:30 AM..
Sponsored Links
    #2  
Old 11-30-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 30 October 2014, 6:26 PM EDT
Location: Saskatchewan
Posts: 19,733
Thanks: 830
Thanked 3,372 Times in 3,159 Posts
In what way does it "not work"?

What does it do?
Sponsored Links
    #3  
Old 11-30-2012
molwiko molwiko is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 1 November 2013, 8:18 AM EDT
Posts: 21
Thanks: 8
Thanked 0 Times in 0 Posts
The second user2 can access everything like user1 which is wrong he should access only directory2
    #4  
Old 12-03-2012
molwiko molwiko is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 1 November 2013, 8:18 AM EDT
Posts: 21
Thanks: 8
Thanked 0 Times in 0 Posts
Any idea how to fix this ?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to get top level parent directory nilayasundar Shell Programming and Scripting 4 10-16-2012 01:06 AM
Redirect with htaccess to upper level folder, how to? Rafaweb UNIX for Dummies Questions & Answers 0 12-13-2010 10:37 AM
How to parse filename and one level up directory name? Shirisha Shell Programming and Scripting 8 10-12-2010 04:37 AM
How to exclude top level directory with find? siegfried Shell Programming and Scripting 3 09-18-2007 11:15 PM



All times are GMT -4. The time now is 12:52 AM.