After some review I'm thinking of eliminating Alias as the recommended way of configuring short urls in MediaWiki and instead exclusively suggesting the use of RewriteRules.
I reviewed how Alias seems to work and I can't see any real advantage at all to using it. Certainly not enough to outweigh the disadvantages to making it a recommendation.
- Internally Apache relies on a PATH_INFO based hack to handle Alias. With Alias a /wiki/Article gets converted to DOCROOT/w/index.php/Article and Apache goes through the PATH_INFO pattern of hunting down the location of the php script. (This is basically a hack) - Alias only works for 1 of the 4 possible Apache contexts. So it ends up requiring us to make our documentation extra complex just to support it. - Alias requires absolute paths while rewrites can take advantage of %{DOCUMENT_ROOT}
The only advantage Alias has I can see is that from the outside it looks like a simple one-line config.
It's been suggested in the past that Alias is faster but I have doubts about that. Even if Apache shortcuts past the rewrite engine and any regxps (which I have a feeling it doesn't) Alias involves Apache's PATH_INFO handling which likely involves a number of stat calls and filesystem IO just to find the location of the php script.
And in any case the php script will take much longer than anything apache is doing so that kind of performance is really a moot point anyways.
To top off the issues with Alias, it can't be used to setup a 404 image thumbnail handler and it can't be used in the future plans of MediaWiki handling 404s internally.
On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
To top off the issues with Alias, it can't be used to setup a 404 image thumbnail handler and it can't be used in the future plans of MediaWiki handling 404s internally.
Don't Wikimedia wikis use Alias? How are they going to handle this?
On Sat, Aug 4, 2012 at 1:07 PM, Benjamin Lees emufarmers@gmail.com wrote:
On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
To top off the issues with Alias, it can't be used to setup a 404 image thumbnail handler and it can't be used in the future plans of MediaWiki handling 404s internally.
Don't Wikimedia wikis use Alias? How are they going to handle this?
Rephrase, how are they handling this?
Also note by the way, that at the moment this thread is primarily about changing the recommended setup in our documentation. Afaik MediaWiki can and will (at least for a long while to come) support both. Even more because the default set up out of the box is /w/index.php/Page_name, and the only way we can make sure existing wikis don't break is by supporting this.
-- Krinkle
On Sat, 04 Aug 2012 14:17:47 -0700, Krinkle krinklemail@gmail.com wrote:
On Sat, Aug 4, 2012 at 1:07 PM, Benjamin Lees emufarmers@gmail.com wrote:
On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen lists@nadir-seen-fire.comwrote:
To top off the issues with Alias, it can't be used to setup a 404
image
thumbnail handler and it can't be used in the future plans of
MediaWiki
handling 404s internally.
Don't Wikimedia wikis use Alias? How are they going to handle this?
Rephrase, how are they handling this?
As far as MediaWiki is concerned Alias and RewriteRules are no different. They both send things to index.php and include a REQUEST_URI. So nothing is going to change with Wikimedia.
This is just dropping Alias as the recommended way of setting up a short url and instead only giving instructions on using the rewrite engine.
Also note by the way, that at the moment this thread is primarily about changing the recommended setup in our documentation. Afaik MediaWiki can and will (at least for a long while to come) support both. Even more because the default set up out of the box is /w/index.php/Page_name, and the only way we can make sure existing wikis don't break is by supporting this.
Btw, on a related note the plan in 1.20 is to stop outputting /index.php/Article style urls by default. That config setup creates a number of issues and has almost none of the advantages that short urls have. Note that the router has a default /index.php/$1 rule so even though we will no longer output PATH_INFO style URLs bookmarks linking to PATH_INFO style urls will not break. Also if a wiki is absolutely obsessed with these messed up urls it's a very simple one-line config tweak to turn them back on.
-- Krinkle
wikitech-l@lists.wikimedia.org