VTSV Posted January 24, 2007 Share Posted January 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
effigy Posted January 25, 2007 Share Posted January 25, 2007 This might work; only applying the authorization to "index.html"[code]<Directory ...> <Files index.html> AuthTypeBasic ...etc... </Files></Directory>[/code] Quote Link to comment Share on other sites More sharing options...
VTSV Posted January 31, 2007 Author Share Posted January 31, 2007 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 Quote Link to comment Share on other sites More sharing options...
effigy Posted January 31, 2007 Share Posted January 31, 2007 Actually, what you originally had should work as long as you add a "+" before Indexes. You can run[tt] ./httpd -t [/tt]from Apache's bin to verify the configuration. Quote Link to comment Share on other sites More sharing options...
VTSV Posted January 31, 2007 Author Share Posted January 31, 2007 Some progress...when I go to /music/ I get a 401 without even being asked for a username/passwordIf I go to /music/index.html I get promted, then 404'd because there is no file with that nameI 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] Quote Link to comment Share on other sites More sharing options...
VTSV Posted February 12, 2007 Author Share Posted February 12, 2007 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 existThen I can access /music/ autoindex by removing index.html from the address barIs it possible to set basic authentication for /music/ and its subdirectories but disable authentication for .wma files? Quote Link to comment Share on other sites More sharing options...
effigy Posted February 13, 2007 Share Posted February 13, 2007 Try this:[code]<Directory "music"> Options +Indexes AuthType Basic AuthUserFile "C:/xxxxxx" Require user xxxxxx <FilesMatch "\.wma$"> Satisfy any </FilesMatch></Directory>[/code] Quote Link to comment Share on other sites More sharing options...
VTSV Posted February 13, 2007 Author Share Posted February 13, 2007 Works perfectly. That's awesome, thanks a bunch! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.