I need to rewrite a files on subdomain to files stored in the folder with name of the subdomain. Only files that start with sitemap
should be rewritten. So, if the requests look like this:
http://demo.domain.com/sitemap.xml http://demo.domain.com/sitemap_more.xml http://test.domain.com/sitemap.xml http://test.domain.com/sitemap_alpha.xml
These should rewrite to files:
/content/sitemaps/demo/sitemap.xml /content/sitemaps/demo/sitemap_more.xml /content/sitemaps/test/sitemap.xml /content/sitemaps/test/sitemap_alpha.xml
So, subdomain name is used as a folder in the rewrite-to-path. This should be rewriting NOT redirecting. Also, it would be good to have rules that will work with any domain without need to change domain name everytime.