views:

130

answers:

1

I have a central script 'web' in the root of my site that handles everything. In the .htaccess the following lines tell appache to handle 'web' as a php file:

<Files web>
ForceType application/x-httpd-php 
</Files>

The script 'web' splits the REQUEST_URI in parts so it can generate the right page: http://www.mysite.com/web/var1/var2/var3 calls 'web' and the script receives var1, var2 and var3.

What i want to do is protect a certain part of the site with .htaccess so that http://www.mysite.com/web/login results in a login-screen. But there is no directory 'login' in which i can put the .htaccess and .htpasswd.

Can this be done?

A: 

also you can use Location:

<Location /path-that-doesnt-exist-in-the-filesystem>
    //your stuff here, for example AuthType Basic, etc...
</Location>
kon
`<Location>` does not work in .htaccess, only in "server config" and "virtual host" context: http://httpd.apache.org/docs/2.2/mod/core.html#location .
ax
I noticed that, location gives a 500 error when put in .htaccess
Overbeeke
i forgot to mention that it works in the config files only. i think it's preferable though, if you have access to them.
kon