I'm trying to redirect calls to my Apache 2.4 virtual host (Wampserver 2.5) that match a certain pattern to a directory outside of my DocumentRoot. Here is the relevant code from my .conf file:
<VirtualHost *:80>
ServerName testserver.dev
DocumentRoot "D:\Path\to\webserver\public\build"
RewriteEngine On
LogLevel alert rewrite:trace6
# Statement below results in 404
AliasMatch "^/sitemap.\d+.xml.gz$" "D:\Path\to\webserver\private\index.php"
</VirtualHost>
When I make a call to apache such as http://testserver.dev/sitemap.1.xml.gz I get a 404 returned from the server. From what I can tell the match is actually working so I'm assuming the directory path is somehow configured wrong? If I hardcode it and use just plain Alias
it works as intended:
# This works below
Alias /sitemap.1.xml.gz "D:\Path\to\webserver\private\index.php"
Not sure what I'm doing wrong. I have logging enabled and this is what shows up in the error log:
init rewrite engine with requested uri /sitemap.1.xml.gz
pass through /sitemap.1.xml.gz
And in the access log for the requests that don't work
"GET /sitemap.1.xml.gz HTTP/1.1" 404 304
Anyone have any idea? I figure this has to be something simple I'm overlooking.