Right, excuse my stupidity, I've looked through a load of examples on t'interweb but I don't think I've found what I'm looking for.
I have a website, photography.example.com
is the main site but I also want to have another subdomain to serve static files, for example static.photography.example.com
.
If I request a file (e.g. http://static.photography.example.com/js/jquery.js
) I want that file to be retrieved from the non-static domain, allowing me to keep my file structure completely untouched but using multiple domains to allow more concurrent http requests.
I don't want to throw any http responses that would make the browser thing the file has been moved, I just want to mirror the files from the normal domain to the static domain. After this I would proceed to set far future expired to improve caching etc.
How do I achieve this using .htaccess
?
EDIT 1
So after a bit of messing around I have come up with this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ http://photography.example.com/$1 [L]
But this actually redirects to the domain I'm trying to read, I want it to serve the file up under the static domain name, any help with modifying this script would be greatly appreciated.
EDIT 2
So I've amended my DNS and waited a few days for it to propagate but the CNAME technique doesn't work either. Here's the entry: