Daniel Friesen | 4 Aug 2012 05:42

Dropping Alias as a recommended way to setup Short URLs

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  
(Continue reading)

Benjamin Lees | 4 Aug 2012 22:07
Picon

Re: Dropping Alias as a recommended way to setup Short URLs

On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen
<lists <at> nadir-seen-fire.com>wrote:

> 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?
Krinkle | 4 Aug 2012 23:17
Picon
Gravatar

Re: Dropping Alias as a recommended way to setup Short URLs

On Sat, Aug 4, 2012 at 1:07 PM, Benjamin Lees <emufarmers <at> gmail.com> wrote:

> On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen
> <lists <at> nadir-seen-fire.com>wrote:
>
> > 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
Daniel Friesen | 5 Aug 2012 02:06

Re: Dropping Alias as a recommended way to setup Short URLs

On Sat, 04 Aug 2012 14:17:47 -0700, Krinkle <krinklemail <at> gmail.com> wrote:

> On Sat, Aug 4, 2012 at 1:07 PM, Benjamin Lees <emufarmers <at> gmail.com>  
> wrote:
>
>> On Fri, Aug 3, 2012 at 11:42 PM, Daniel Friesen
>> <lists <at> nadir-seen-fire.com>wrote:
>>
>> > 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
(Continue reading)


Gmane