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
Share on other sites

Thanks, it works if there's an index.html but I've got autoindexing on so it's giving me a 401.

Coming at it from the other side, is there a way to override the authentication for my MP3 and WMA files?

Thanks again!
~Steve
Link to comment
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]
Link to comment
Share on other sites

  • 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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.