skippybosco
07-09-2009, 11:27 AM
Hello all.
I have a protected podcast that I make available via my website as well as through iTunes.
For visitors streaming the podcast on my site I have a session based cookie that is set and use rewrite rules to either allow access (if cookie is exists and is valid) or redirect to a styled login page using aMember.
iTunes, however, only supports Basic Auth protection. If I switch my .htaccess over to that, it pops up a non-styled browser login/password dialog for my web visitors, even if they have an existing cookie established (bummer!)
Ideally, I'd like to configure an .htaccess conditional rule that says:
If user_agent = itunes do this:
AuthType Basic
AuthName "Members Only"
AuthUserFile /home/mydomain.com/amember/data/.htpasswd
AuthGroupFile /home/mydomain.com/amember/data/.htgroup
Require valid-user
else, everyone else do this:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
RewriteCond /home/mydomain.com/amember/data/new_rewrite/%1 -f
RewriteRule ^(.*)$ - [L]
Is this kind of logic possible?
Can anyone provide guidance on the correct syntax?
I'm guessing some use or combination of:
SetEnvIfNoCase "User-Agent" "itunes" itunes
Thanks in advance!!
I have a protected podcast that I make available via my website as well as through iTunes.
For visitors streaming the podcast on my site I have a session based cookie that is set and use rewrite rules to either allow access (if cookie is exists and is valid) or redirect to a styled login page using aMember.
iTunes, however, only supports Basic Auth protection. If I switch my .htaccess over to that, it pops up a non-styled browser login/password dialog for my web visitors, even if they have an existing cookie established (bummer!)
Ideally, I'd like to configure an .htaccess conditional rule that says:
If user_agent = itunes do this:
AuthType Basic
AuthName "Members Only"
AuthUserFile /home/mydomain.com/amember/data/.htpasswd
AuthGroupFile /home/mydomain.com/amember/data/.htgroup
Require valid-user
else, everyone else do this:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
RewriteCond /home/mydomain.com/amember/data/new_rewrite/%1 -f
RewriteRule ^(.*)$ - [L]
Is this kind of logic possible?
Can anyone provide guidance on the correct syntax?
I'm guessing some use or combination of:
SetEnvIfNoCase "User-Agent" "itunes" itunes
Thanks in advance!!