drupal how to add url alias to "sites/all/modules/..."
alias: admin/a/b
source: sites/all/modules/somemodule/somefile
I tried in menu, pathauto, they both report such source path does not exist or I don't have permission. How can this be achieved i开发者_高级运维n most easy way?
Url alias doesn't work with files, only paths that are known by Drupal (defined in the code/database).
Update:
Path aliases work by rewriting the url into something that Drupal understands. So if you wanted to make an alias to a file, you would need to serve the file yourself, since Drupal doesn't serve the files.
If you really wanted to, you could make a redirect to the file from, but that's not pretty.
Try setting the Download Method to private, under admin/settings/file-system. If you do, Drupal will serve your files and the redirects might work (I didn't test it myself... :-).
Naturally, this has a price in terms of performance. Your links will look different.
If you want to keep the public download method, your need to redirect in the HTTP server level, because file requests are not going through Drupal in that case.
精彩评论