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://...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |