Now, I have two sites sharing the same Drupal codebase, one at sites/default, the other at sites/site2.com. What I want to do is (primarily):
Make each sites' public files inaccessible to the other.
Redirect URLs like http://www.default.com/sites/default/file.pdf to a custom, clean path like http://www.default.com/releases/file.pdf and http://www.default.com/images/image.png
Also, I'd like to set up a multisite, but not a traditional one. I'd like, for example forums.default.com to host just the forums for the same site (Drupal default ones), so whenever I click on Forums in navigation, I get redirected to it. Or images.default.com for images, wiki.default.com for the book pages (wiki). Possible?
Comments
I've done something similar
I've done something similar in terms of creating my own clean download URL's. You might want to checkout hook_file_download and create a menu router.
I can't remember the exact code I used, not on this machine at the moment, but essentially I created a menu router called:
document/%
The ID passed could be your FID or your filename.
I find issues with filenames are that they're never consistent and if you're working with other sources to provide you with them they can be difficult to manage.
Instead I created a new content type called document. In the document content type I added a File field allowing a single file to be attached to that node.
Then I created a custom menu router, as described above, and link the node ID - not the FID. The reason I link the NID was that the FID can change if you update the file with a new one as fid will increment. If you refer to the NID your download asset will always contain the same URL across your site.
Hope that helps!
Steve