Page MenuHomePhabricator

Repair "" redirect for
Open, LowPublic


Someone fixed the redirects.conf file so that redirects to, because no longer exists since a while.;46785c71c5eab2b987363e83ec2a6f26a6d6dea5$463

For, this works.

However, and, and anything that has a slash in it, remains broken.

RewriteRule ^/doc$ doesn't match anything except /doc. If it was "RewriteRule ^/doc/(.*)$, then it would. But is changing
override -> override*) wanted behaviour? Would it cause issues?

Event Timeline

Southparkfan raised the priority of this task from to Needs Triage.
Southparkfan updated the task description. (Show Details)
Southparkfan added a subscriber: Southparkfan.
Dereckson added a project: User-Dereckson.
Dereckson added a subscriber: Dereckson.
Krinkle added a project: patch-welcome.
Krinkle added a subscriber: Krinkle.

Just fixed another one of these (edit). Looks like there are many more broken urls on wiki pages,

Probably many more broken urls on other wikis, in commit messages, other websites, and perhaps in less mutable publications/archivings.

Krinkle renamed this task from<any page> should redirect to to Repar "<any page> should redirect to 5 2019, 7:22 PM
Krinkle renamed this task from Repar "<any page> should redirect to to Repair "" redirect for
Krinkle edited projects, added SRE; removed Wikimedia-Apache-configuration.
Krinkle added a subscriber: apaskulin.

I've asked about this on IRC. It seems to only take a 1 line change in Puppet to fix the redirect. But in 2013 when this task was filed there seems to have been some confusion about how override works. If this is still an issue, one may want to reach out via Scrum of Scrums that you are blocked on SRE to answer that concern.

Perhaps simplest to submit the change as written and handle the details in code review instead.

CCicalese_WMF added a subscriber: CCicalese_WMF.

Untagging Platform Engineering, since there is currently no work for the team to do on this.

Current status redirects to redirects to

The redirects are so like described in the task.

Proposal plan

The example given /doc/classWikiPage.html is rather trivial to fix, as the filenames didn't change:

So I guess the best plan is to redirect*) to$1

(and address during code review any override issue, if any, per Krinkle comment)

Actually, you can use the compiler of redirect.dat as a software to output to stdout the result:

ruby modules/mediawiki/lib/puppet/parser/functions/compile_redirects.rb modules/mediawiki/files/apache/sites/redirects/redirects.dat

Also, this language has rules to avoid to write and maintain regexp for trivial cases, like redirect a whole domain.

The current rules don't allow the more complex redirection where a PART of the original URL has to been taken.

The easiest is to provide more flexibility and allow to directly pass Apache/nginx regexp in redirects.dat for more complex cases.

I'm submitting a path with this approach, it provides the following redirect:

# regexp*)$1
RewriteCond %{HTTP_HOST}
RewriteRule ^/doc(/.*)$$1 [R=301,L,NE]

Change 631888 had a related patch set uploaded (by Dereckson; owner: Dereckson):
[operations/puppet@production] Redirect properly