Here is my problem. I've got file (eg. some.xml) and multisite Drupal 7 installation. How can I allow to download this xml from my-multi-site.domain/some.xml? Is there any way to do it without writing custom module with hook_menu?

P.S. this file should be different for every site on multisite installation


The proper solution is a hook_menu, which I believe is also going to be a requirement to make this reasonable when several sites want separate names.

I workaround would be to just symlink it to your Drupal root.

ln -s sites/example.com/files/somefile.xml some.xml

But if it's a requirement to have each filename only available on one domain, apache would need to have logic to block the "wrong" names, which is inconvenient.

A third possibility would be to rewrite the URL in apache, but I don't exactly know the syntax for this.

  • I've forgot to mention, but this file should be different for every site, however thanks for answering. Feb 3 '12 at 13:09

I decided to solve this problem by serving this file through nginx. That is not a universal solution, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.