Apache - Location vs Directory Directives -


im not familiar apache.

  • when using <location>, able redirect users sign-on page, forcing them authenticate , have proper privileges before accessing url.
  • when using <directory>, supposed allow me control access specified folders , directories, right?

question:
how <directory> behave , differently <location>?

  • with <location /web>: www.mysite.com/web , www.mysite.com/web/foo controlled.
  • with <directory /webforms>: how www.mysite.com/web if of scripts folder?
  • with <directory /pictures>: how www.mysite.com/web if of picture folder?
  • what situation have both types of directives active , affecting single page? kinds of things should expect or watch out for?

the apache http server documentation has section called what use when which, think, directly, answer question :

choosing between filesystem containers , webspace containers quite easy. when applying directives objects reside in filesystem use <directory> or <files>. when applying directives objects not reside in filesystem (such webpage generated database), use <location>.

the important part following :

it important never use <location> when trying restrict access objects in filesystem. because many different webspace locations (urls) map same filesystem location, allowing restrictions circumvented.

read on more information...


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -