Page MenuHomePhabricator

UrlShortener-shortened URLs require two redirects to dereference
Closed, ResolvedPublic


Example: redirects to which redirects to the actual link target,, which redirects to, which redirects to That's 4 redirects!

We can eliminate the first redirect at the Apache layer. The latter three could be eliminated if UrlShortener fetched the target URLs, following any HTTP 301 responses, and using the final target URL as the short URL target.

Related Objects

Event Timeline

ori created this task.Aug 10 2015, 6:11 PM
ori raised the priority of this task from to Low.
ori updated the task description. (Show Details)
ori added subscribers: ori, Legoktm.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 10 2015, 6:11 PM
ori added a comment.Aug 10 2015, 6:13 PM

(This is not a deployment blocker, IMO.)

The first redirect to UrlRedirector isn't supposed to happen, but the labs wiki setup is a bit of a hack (P1543).

The last HTTP -> HTTPS redirect won't happen in Wikimedia production since UrlShortener redirects using the current protocol, and the short domain will be HTTPS-only.

I believe the original issue might have been fixed.

$ wget --max-redirect=0 "" 
--2019-04-14 01:42:21--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: [following]
0 redirections exceeded.
Legoktm closed this task as Resolved.Aug 1 2019, 7:31 AM
Legoktm claimed this task.