Need help with perms

This is a discussion on Need help with perms within the Apache Web Server forums, part of the Web Server and Related Forums category; I have a dir which is protected against unauthorized users using mod rewrite: RewriteEngine on RewriteCond %{REMOTE_USER} !^authorized_user_name_here$ RewriteRule .* http://...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-11-2005
Ridge Burner
 
Posts: n/a
Default Need help with perms

I have a dir which is protected against unauthorized users using mod
rewrite:

RewriteEngine on
RewriteCond %{REMOTE_USER} !^authorized_user_name_here$
RewriteRule .* http://pathto404.html [R,L]

Now I need to allow ALL users access to one specific file in the directory
so I tried:

<FILES "myimage.jpg">
Order Allow,Deny
Allow from all
</FILES>

Now there seems to be some conflict with these two rules, and I cannot
figure out how to get them to work together. Hopefully I am on the right
track, and someone can help me with the correct directives to get this to
work!

So, Basically I need to allow all users access to the file "myimage.jpg",
without giving access to any other files in the directory with the exception
of admins, who can see everything.

Thanks much,

--Ridge


  #2 (permalink)  
Old 11-11-2005
Robert Ionescu
 
Posts: n/a
Default Re: Need help with perms

Ridge Burner wrote:
> I have a dir which is protected against unauthorized users using mod
> rewrite:
>
> RewriteEngine on
> RewriteCond %{REMOTE_USER} !^authorized_user_name_here$
> RewriteRule .* http://pathto404.html [R,L]

[...]
> So, Basically I need to allow all users access to the file "myimage.jpg",
> without giving access to any other files in the directory with the exception
> of admins, who can see everything.


Hi,
just adjust the RewriteRule a little bit:

RewriteEngine on
RewriteCond %{REMOTE_USER} !^authorized_user_name_here$
# if filepath is not image.jpg, redirect
RewriteRule !myimage\.jpg$ http://pathto404.html [R,L]

--
Robert
  #3 (permalink)  
Old 11-15-2005
Ridge Burner
 
Posts: n/a
Default Re: Need help with perms

Excellent!!! Thanks much Robert! That was the solution I needed. I was
playing with <Files> and <FileMatch> but they seemed to get overridden by
rewrite rules.

-Ridge

"Robert Ionescu" <robsiegen@gmail.com> wrote in message
news:4374cedf_1@x-privat.org...
> Ridge Burner wrote:
>> I have a dir which is protected against unauthorized users using mod
>> rewrite:
>>
>> RewriteEngine on
>> RewriteCond %{REMOTE_USER} !^authorized_user_name_here$
>> RewriteRule .* http://pathto404.html [R,L]

> [...]
>> So, Basically I need to allow all users access to the file "myimage.jpg",
>> without giving access to any other files in the directory with the
>> exception of admins, who can see everything.

>
> Hi,
> just adjust the RewriteRule a little bit:
>
> RewriteEngine on
> RewriteCond %{REMOTE_USER} !^authorized_user_name_here$
> # if filepath is not image.jpg, redirect
> RewriteRule !myimage\.jpg$ http://pathto404.html [R,L]
>
> --
> Robert



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:44 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0