RewriteCond triggered by HTTP auth failure?

Sep 19, 2008 16:44

Ye Googles are not helping me here...Is there a way to invoke a RewriteCond directive that returns true in the event of an HTTP auth failure? The goal here is to have apache alongside a squid reverse proxy, with apache serving active content directly but issuing 301 redirects to squid for static content (In lieu of renaming all the img src tags to point there directly...). squid is configured to use HTTP auth to access the content from apache; but since the world won't have that auth data, they should receive a 301 instead. So basically, something like this:

RewriteEngine on
  RewriteCond (If authentication fails)
  RewriteRule ^(.*)$ http://proxy.example.com/$1 [R=301,L]
Previous post Next post
Up