Forum Moderators: phranque

Message Too Old, No Replies

Using .htaccess with ASP

Protecting both ASP pages and Excel files

         

VTwebworker

9:19 pm on Sep 3, 2006 (gmt 0)

10+ Year Member



Hi All,

I have two kinds of content I'm looking to protect, ASP pages, as well as extra files (excel, word, etc). I have everything in a private folder on our webserver (shared host), and am using .htaccess to password protect them, which works great. However, I'm getting complaints about the login box, and the inability to "log out". I've read the Apache documentation, and know that the answer on that end is "tough". However, I was wondering if anybody knew of an easy (relatively speaking) way to use ASP to password protect the ASP files (this I have) AND pass those same credentials to .htaccess, for when somebody wants to access an excel file. The end goal here being if somebody bookmarks the excel file, they are still forced to login to view it.

Casey

jdMorgan

8:53 pm on Sep 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer depends on what form these credentials take. I'm not an ASP user, so I don't know.

You can't pass anything to .htaccess, except through the incoming HTTP request itself. So, you can check the requested URL, query string, REMOTE_USER, or cookies if that helps.

Jim