Http Basic Authentication

wordpress

#1

Hello smart people!
I’ve spent the last two days trying to understand and solve this problem. Not quite there yet, I’m hoping for some advice.

I have a Wordpress install on shared hosting here. It is a podcast using Blubrry’s PowerPress for serving up podcasts. URL is www.dribblecast.org. (I’m actually using this as a dev site getting ready to roll this out on the main podcast, www.drabblecast.org.)

The podcast is wanting to offer a premium subscription feed. PowerPress has a function for this. All is good, except the feed auth is handled through http Basic authentication. Since PHP on Dreamhost shared severs is run only using CGI or FastCGI, Apache does not pass the http authentication to PHP. (Apparently mod_php does this fine.)

There are a number of places which recommend how to work around this, like this one.

There seems to be a problem when doing this with Wordpress. Now, any time I go to a non-existing page, or even the correct URL for the podcast, I get a generic 404 Not Found. Not the wordpress pretty page, just a generic 404.

The feed URL I’m testing is www.dribblecast.org/feed/feedslug .

Here is my .htaccess in the root folder. I’ve removed all the WP Supercache entries.

[code]
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress[/code]

Now if I move the http auth code to below the WordPress block, things start working properly again, but of course the auth fails.

I clearly don’t understand .htaccess well enough to understand my failure. Any of you smart people have ideas?
Thanks!
Tom


#2

You may want to use a more selective URL.

RewriteRule ^feed/.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Something to just force only feeds.


#3

Thanks for the suggestion!
Wow, I think I finally got it working.
First off, I found a comment saying to not use “L”, since it will skip following rewrite rules. Hence my 404’s.
Second, adding just the rewrite rule to the .htaccess file was all I needed to do! Putting the php code in, in fact, prevented it from working. I’m not sure why, but I’m happy at this point!