|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello,
i have a dir in which are my *.html and *.php pages as well as my /images directory. What i want to do is, deny access to this dir. from the outside world. for example if a request: http://mydomain.com/homedir/images/ is sent DENY it. I know this can be acomplished using .htaccessm however i dont know what goes in it.. indexing maybe... dont know.. pls help.. many thankx in advance.... -Mike |
|
#2
|
|||
|
|||
|
You don't do that. Denying /homedir/images/ would make all images on your html pages at http://mydomain.com/ to be broken. Please tell us what is your main purpose for doing it.
|
|
#3
|
|||
|
|||
|
i understant that my web server wont have access to the images... well basicaly i just dont want the visitors viewing my /images dir.. i didnt mean just the images dir.. but any dir (in general) lets say i have a dir with WORD documents in it which i only want to be avail. to the internal LAN.. how could i implement this..
thankx for your help... |
|
#4
|
|||
|
|||
|
>> which i only want to be avail. to the internal LAN
Perhaps for LAN users while roaming? Then you should try the following: # http://mydomain.com/homedir/images/.htaccess AuthName "LAN users only" AuthType Basic AuthUserFile /path/to/one/common/.htpasswd require valid-user Order Deny,Allow Deny from all Allow from 192.168.0.0/24 Satisfy any # http://mydomain.com/homedir/documents/.htaccess AuthName "LAN users only" AuthType Basic AuthUserFile /path/to/one/common/.htpasswd require valid-user Order Deny,Allow Deny from all Allow from 192.168.0.0/24 Satisfy any In doing so, your LAN users can access to documents dir and images dir without prompting for authentication. While they are roaming, their IP no longer falls under 192.168.0.x, then they will be prompted to authenticate. Simply denying world access including yourself is pointless but to use your web space as storage. Check out http://httpd.apache.org/docs/mod/core.html#satisfy Also, I used /path/to/one/common/.htpasswd simply because you don't need to create a different set of .htpasswd for different directory, you can share it. |
|
#5
|
|||
|
|||
|
|
|
#6
|
|||
|
|||
|
THANKQ SO MUCH
thankx so much to both...
this is very helpful info, just what i need to get started, i see everything can be done from a .htaccess file.. very flexible... thankx again.. Mike apache newbie |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > .htaccess |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|