Mobile app version of vmapp.org
Login or Join
Shanna517

: Password protecting dynamic URLs in Apache I am handling many logical files request using the Apache server. To make the path simple I have used mod_rewrite in the httpd.conf. Now I am planning

@Shanna517

Posted in: #Apache #Htaccess #Password #Security

I am handling many logical files request using the Apache server. To make the path simple I have used mod_rewrite in the httpd.conf.

Now I am planning to enforce authentication on these logical file (dynamic content) in .htaccess. Apache Documentation tells that only Files directives can be used in .htaccess.

Files directive only accept the path of the files that are present on the disk and does not support logical files. How do I overcome this? How can I give the full path of my URL to enforce diff types of authentication?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Shanna517

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

An easy method would be to use a trigger, calling a php file that physically exists on the disc and calling it in your dynamic content which should trigger the password prompt.

You'd just need to use an empty php file in say /protected/ and ensure that the rest of the file isn't processed until the empty php file is read.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme