I have a system where I'm hosting a number of SSL sites on my server. I also need to setup OAuth for each domain, with Google and Yahoo in particular. They each require verification files be installed on the server, in order to validate ownership. There are so many of these files now that they're clogging my root directory. So I want to set up a rewrite rule to sends a request to a particular URL to a verification file directory, like so:
RewriteRule (^/googlew*.html$) /verifications$1
This sends a Google verification file request such as http://server/google27c81d94580e55dd.html to http://server/verifications/google27c81d94580e55dd.html, and without rewriting the URL it works fine.
But when the request goes to an SSL URL, it fails. Here's my configuration:
<VirtualHost *:80> ServerName <domain> DocumentRoot /www/public RewriteEngine On RewriteRule (^/googlew*.html$) /verifications$1 [R] RewriteRule (^.*--.html$) /verifications$1 [R] </VirtualHost> <VirtualHost <ipaddress>:443> SSLEngine On ServerName <domain> DocumentRoot /www/public RackEnv production RewriteEngine On RewriteRule (^/googlew*.html$) /verifications$1 [R] RewriteRule (^.*--.html$) /verifications$1 SSLProtocol all SSLCipherSuite HIGH:MEDIUM SSLCertificateChainFile /usr/share/ssl/crt/intermediate.crt SSLCertificateFile /usr/share/ssl/crt/<domain>/<domain>.crt SSLCertificateKeyFile /usr/share/ssl/crt/<domain>/<domain>.key </VirtualHost>
So when the request is non-secure HTTP, it works fine. When it's secure HTTPS, it fails. Any suggestions as to why?
UPDATE As requested, here's the output of the Rewrite Log at level 3:
init rewrite engine with requested uri /google27c81d94580e55dd.html applying pattern '(^/googlew*.html$)' to uri '/google27c81d94580e55dd.html' applying pattern '(^.*--.html$)' to uri '/google27c81d94580e55dd.html' pass through /google27c81d94580e55dd.html
Now here's the funny thing: prior to making my original post, as I said the non-secure version was working fine. After I posted, the non-secure version stopped working as well! The log entry I've just pasted in is what I get when running the non-secure version. Face. Exploding.