qwertq
asked on
deny direcotory listing, allow by ip
i want to deny directory listing via htaccess, but allot a certain ip (mine) to see it.
ASKER
hm, that seems to block access to the files inside.
i want the files contained in this directory to be visible, i only want to block dir listing
i want the files contained in this directory to be visible, i only want to block dir listing
how about creating a second virtual directory that points to the same spot, allow your ip only and give it directory browse rights?
AJ.
AJ.
ASKER
can this not be done simply with htaccess?
alternate solution if you can't get it going with htaccess (not really an answer to the question - sorry about that)
you need a second <Location> one which has
Option -Indexes
has no LIMITs, and one with
Option +Indexes
has password protected LIMITs
Option -Indexes
has no LIMITs, and one with
Option +Indexes
has password protected LIMITs
ASKER
thank you a hoffman, but i have no idea what you are talking about
<Location /dir-no-index>
Options -Indexes
</Location>
<Location /dir-with-index-but-protec ted>
Options +Indexes
<LIMITExcept HEAD GET>
Order deny,allow
Deny from all
Allow from localhost
</LIMIT>
</Location>
if you call in your URL /dir-no-index you get a 404 not found ('cause index is off)
if you call in your URL /dir-with-index-but-protec ted you get a 401 not authorized except if caled from localhost
you may also add your public IP, or even network masks here
Allow from localhost your.FQDN
Options -Indexes
</Location>
<Location /dir-with-index-but-protec
Options +Indexes
<LIMITExcept HEAD GET>
Order deny,allow
Deny from all
Allow from localhost
</LIMIT>
</Location>
if you call in your URL /dir-no-index you get a 404 not found ('cause index is off)
if you call in your URL /dir-with-index-but-protec
you may also add your public IP, or even network masks here
Allow from localhost your.FQDN
ASKER
i was never able to get a working example of this problem.
i want ONE directory which will deny dir listing to it and all child directories to anyone except a certain ip. it needs to allow the website to use the contents of the dir as well.
i want ONE directory which will deny dir listing to it and all child directories to anyone except a certain ip. it needs to allow the website to use the contents of the dir as well.
and what's wrong with my last suggestion?
"not working" is no valid answer
"not working" is no valid answer
ASKER
"if you call in your URL /dir-no-index you get a 404 not found ('cause index is off)
if you call in your URL /dir-with-index-but-protec ted you"
this is not one location, and will not work. my source would reflect "dir-with-index-but-protec ted you/"
if you call in your URL /dir-with-index-but-protec
this is not one location, and will not work. my source would reflect "dir-with-index-but-protec
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<Location /directory>
Options +Indexes
<LIMITExcept HEAD GET>
Order deny,allow
Deny from all
Allow from localhost
</LIMIT>
</Location>