R – Mediawiki / Excel: Hyperlink from Excel to a non-existant wiki page gives a 404 – how can I fix or work around this

excelhttp-status-code-404hyperlinkmediawikiwiki

I suspect this could be something faulty with Excel (although I keep an open mind), but I wondered if anyone knew how I could get around this apparent bug:

I wish to create Excel spreadsheets which link to pages in a local wiki (running MW 1.14.0, full details below) where those pages don't yet all exist.

The idea is that over time we will fill in details of the pages, but we would like to create the links now (because copies of the Excel files will get sent out to various internal users and it will not be feasible to go track them down and add links later once the pages are created)

The problem is that when I create such a hyperlink in Excel and then go to follow the hyperlink, I get a message back indicating that the page does not exist. The full text of the message is:

"Unable to open http://. The Internet site reports that the item you requested could not be found. (HTTP/1.0 404)"

This happens on our site or in fact if you link to a non-existant page on wikipedia (e.g. http://en.wikipedia/wiki/Swed53rf). Whereas if you put such a link into a browser you get the correct response (which is to be taken to a page indicating that there is no such page but that you can create it by following the usual link)

Is there some setting on Apache that I might need to configure / override to make sure it returns a valid server response to Excel?

Creating links to existing pages works fine. I appreciate that in theory we could go around creating all the pages that are required, but some of the people involved in the project (creating the initial Excel files) do not / cannot use our wiki and it would be better if this just worked as it would appear it should rather than having to try to add steps to work around it in this way.

I also wondered if it were anything to do with the short URL reformatting. Our wiki, like wikipedia has short URLs, eg:
http://server/w/index.php?title=User:Joe_Blogs/Sandbox
can be reached from
http://server/wiki/User:Joe_Blogs/Sandbox

but including hyperlinks to the full name versions of the pages does not resolve the issue.

The version of Excel being used is Excel 2003 (SP3)

I have discovered that this also happens with Word 2003 (I imagine they are using the same code). However the desired behaviour occurs with Lotus Notes (a miracle, as it's rubbish in so many other ways! )

I have not done any significant development on Apache, but I could consider some form of custom page that re-directs to the non-existent wiki page if Mediawiki changes were deemed to complex/tricky. (although I'm not particularly sure where I'd start with this idea, I'm guessing some sort of URL parameter to accept the destination pagename might be a possible approach)

Any helpful suggestions gratefully received!!

[FYI: I have posted a question on MWUsers forum (www.mwusers.com) too after Googling this to no avail! I'll update the forum response there if I get an answer here or vice versa]

Many thanks,
Neil

Running on Ubuntu Server 8.10

Product Version:

MediaWiki 1.14.0

PHP 5.2.4-2ubuntu5.6 (apache2handler)

MySQL 5.0.51a-3ubuntu5.4

Installed extensions:

CategoryTree (Version r44056)

Renameuser

CategoryTree (Version r44056)

ImageMap (Version r35980)

ParserFunctions (Version 1.1.1)

StringFunctions (Version 2.0.2)

Best Answer

Not sure how to get Excel to let you go to a page which turns out to be a 404, but as a temporary workaround, you can hack out MediaWiki's 404 reporting on missing pages...

In MediaWiki 1.14 or 1.15 releases this will be in Article::view() in includes/Article.php:

    if( $return404 ) {
        $wgRequest->response()->header( "HTTP/1.x 404 Not Found" );
    }

Note that the latest dev code is a little different, but you can find it where it sends the same header in the same file. :)

Related Topic