Page MenuHomePhabricator

Apache RewriteRule for Extension:ShortUrl deployment
Closed, ResolvedPublic

Description

Currently just needed for tawiki and orwiki in relation to
https://bugzilla.wikimedia.org/show_bug.cgi?id=1450 and
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ShortUrl/
I think it's going to need to be something like the below, but not confirmed...
Or would this be better done at some other level?
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ /wiki/Special:ShortUrl/$1 [R]


Bugzilla Ticket: 1450 => T3450: Enable Extension:ShortUrl on or.wikipedia, ta.wikipedia...

Details

Reference
rt2121

Event Timeline

• rtimport raised the priority of this task from to Medium.Dec 18 2014, 1:05 AM
• rtimport set Reference to rt2121.

On Mon Dec 12 18:51:39 2011, reedy wrote:

Currently just needed for tawiki and orwiki in relation to
https://bugzilla.wikimedia.org/show_bug.cgi?id=1450 and
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ShortUrl/

I think it's going to need to be something like the below, but not
confirmed...
Or would this be better done at some other level?

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ /wiki/Special:ShortUrl/$1 [R]

Eww, no, please don't.
First, we shouldn't be using rewrite rules if we can at all avoid it and use
aliases instead.
Second, it looks like this rewrites /123 to /wiki/Special:ShortUrl/123 ? If so,
doesn't that mean that things like /w and /wiki are also valid short URLs, and
would either be remapped (which would break things) or not (which would break
them as short URLs)? That's asking for trouble.

Status changed from 'new' to 'open' by RT_System

On Mon Dec 12 21:55:19 2011, catrope wrote:
<br />&gt; On Mon Dec 12 18:51:39 2011, reedy wrote:
<br />&gt; &gt; Currently just needed for tawiki and orwiki in relation to
<br />&gt; &gt; https://bugzilla.wikimedia.org/show_bug.cgi?id=1450 and
<br />&gt; &gt;
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ShortUrl/
<br />&gt; &gt;
<br />&gt; &gt;
<br />&gt; &gt; I think it's going to need to be something like the below, but
not
<br />&gt; &gt; confirmed...
<br />&gt; &gt; Or would this be better done at some other level?
<br />&gt; &gt;
<br />&gt; &gt; RewriteEngine On
<br />&gt; &gt; RewriteRule ^([a-zA-Z0-9_-]+)$ /wiki/Special:ShortUrl/$1 [R]
<br />&gt; Eww, no, please don't.
<br />&gt;
<br />&gt; First, we shouldn't be using rewrite rules if we can at all avoid it
<br />&gt; and use
<br />&gt; aliases instead.
<br />&gt;
<br />&gt; Second, it looks like this rewrites /123 to
/wiki/Special:ShortUrl/123
<br />&gt; ? If so,
<br />&gt; doesn't that mean that things like /w and /wiki are also valid short
<br />&gt; URLs, and
<br />&gt; would either be remapped (which would break things) or not (which
<br />&gt; would break
<br />&gt; them as short URLs)? That's asking for trouble.
<br />
<br />
<br />
One presumed that you might have discussed that as part of your CR ;)

Seriously RT, WTH?
Anyway, this doesn't exactly have to be in place for deployment...
/wiki/Special:ShortUrl/12345 is still shorter than some of the URLs they are
using now

yuvipanda wrote:

ShortURL master has PathRouter support, so the Rewrite rule can now be<br />
RewriteRule ^/s/.*$ /w/index.php

Ben and I worked on this a bit. Ben prepared the one-liner to
apache-config: https://gerrit.wikimedia.org/r/16742
Sam reenabled the extension in test and test2 and I tested it
successfully on test.wp.org.
We are planning to deploy this change on production apaches on Monday.
After that, and verifying that it works well for test2 wiki, wikis can
be enabled in MW per BZ #1450.

This was deployed on the cluster moments ago. test2.wp.org works, Sam
Reed is enabling the extension for the requested wikis per the Bugzilla
ticket.
The rest of the progress will be tracked there; resolving this, as
there's nothing else that needs to be done from the ops side.

Status changed from 'open' to 'resolved' by faidon

Dzahn changed the visibility from "WMF-NDA (Project)" to "Public (No Login Required)".Sep 20 2016, 2:34 AM
Dzahn changed the edit policy from "WMF-NDA (Project)" to "All Users".
Dzahn set Security to None.
Dzahn added a subscriber: Krenair.