Take the 2-minute tour ×

When clicked, "[[Media:spreadsheet.xls]]" successfully loads the spreadsheet in Excel.

However, a page containing "#REDIRECT [[Media:spreadsheet.xls]]" just goes to the "mywiki/index.php?title=Media:spreadsheet.xls" page instead of serving up the actual spreadsheet file.

How can I create a redirect so that it loads the file directly, instead of going to the "index.php" 'meta' page?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Instead of using an ordinary page with a redirect, create a template which produces the direct link, and update the template as needed.

share|improve this answer
Great, not sure why I didn't think of this, but that's just what I wanted! –  Chris Apr 17 '11 at 11:38

The #REDIRECT redirects one page to another page. It cannot redirect to a media item.

The page you see when you redirect to a media item is just another Wiki page (albeit an auto-generated one).

You would think that if you could somehow insert a #REDIRECT into that page that it would do what you want, but no...

Double redirects




So I am sorry, but unless you fancy re-writing how parts of MediaWiki work, you are stuck with having it redirect to the media page.

share|improve this answer
That's a shame. There's basically a spreadsheet which is updated daily, which I had hoped to link to from several places in the Wiki, and still keep a history of the older versions. I realise I could simply replace the file in the wiki, but this makes it a little harder for end users (as does the meta page). Do you (or anyone else) have any suggestions of the best way to do this? –  Chris Apr 14 '11 at 8:53

Your Answer


