Jump to content

Authenticate index only, not files


VTSV

Recommended Posts

Hey y'all,

I've searched far and wide for a solution to this but can't quite find one, and I've tried different things myself but to no avail.

I currently have all my music available via HTTP, using basic authentication so not just anyone can get it.
[code]<Directory "music">
Options Indexes
AuthType Basic
AuthUserFile "C:/xxxxxx"
Require user xxxxxx
</Directory>[/code]

What I'm looking to do is remove the need for authentication for the files themselves, but not the indexes.  So, for example, if I were to send my friend a link to a song, they wouldn't have to enter a username or password, but at the same time, if they tried to access the index, they would.

Thanks in advance for any help!
~Steve
Link to comment
https://forums.phpfreaks.com/topic/35598-authenticate-index-only-not-files/
Share on other sites

Some progress...when I go to /music/ I get a 401 without even being asked for a username/password
If I go to /music/index.html I get promted, then 404'd because there is no file with that name
I can then access /music/ and its subfolders.  Music files I can access fine without authentication (thanks!)

Any way I can skip that extra step and be authenticated on /music/ ?
[code]DirectoryIndex index.html index.php

<Directory "music">
Options +Indexes
IndexOptions FancyIndexing FoldersFirst IconsAreLinks NameWidth=* SuppressDescription SuppressLastModified
<Files index.html>
AuthType Basic
AuthName "Music"
AuthUserFile "xxx"
Require user xxx
</Files>
</Directory>[/code]
  • 2 weeks later...
Any more ideas?

Right now I get a 401 when going to the autoindexed /music/
It asks for authentication when I go to /music/index.html, but then I get a 404 because that file doesn't exist
Then I can access /music/ autoindex by removing index.html from the address bar

Is it possible to set basic authentication for /music/ and its subdirectories but disable authentication for .wma files?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.