Implement redirects, other features in Kuma instead of Apache



a year ago
a year ago


(Reporter: jwhitlock, Assigned: jwhitlock)




(Whiteboard: [specification][type:feature])



a year ago
What problem would this feature solve?
When features are implemented in Apache configuration files:

1) Development behaves differently than production, leading to unexpected results and difficulty in reproducing issues
2) We're tied to also using Apache in AWS

Who has this problem?
Staff contributors to MDN

How do you know that the users identified above have this problem?
Security efforts like bug 827398 and bug 1076893 rely on Apache configuration, and have been open for multiple years.  This is partially prioritization, and partially because of the cross-team coordination needed to update Apache configurations.

How are the users identified above solving this problem now?
Open bugs like infrastructure bug 1353132 to request changes to the Apache configuration.  It is normal for these requests to take 1-2 weeks, because of the issues in cross-team collaboration, synchronizing with deployments, and monitoring that the site is not broken.

Do you have any suggestions for solving the problem? Please explain in detail.
Bedrock has implemented redirects in Django, as part of the effort to move to AWS.  pmac has packaged that solution in a Django app [1].  The dual configuration can be shipped (both Apache and Django supporting redirects), tested in a Django-only deployment in AWS, and then the now-redundant Apache directives can be removed using bug requests on the normal schedule.


Is there anything else we should know?
AWS / SRE effort tracked in GitHub issue mozmar/infra#180


a year ago
See Also: → bug 827398

Comment 1

a year ago
Commit pushed to master at
bug 1362438: Merge pull request #4217 from mozilla/dp_redirect_requirements

bug 1362438 - add deps for django-redirect-urls + tests

Comment 2

a year ago
Commit pushed to master at
bug 1362438: Merge pull request #4220 from mozilla/dp_httpd_redirects

implement SCL3 httpd redirects in Django
Keywords: in-triage

Comment 3

a year ago
Commits pushed to master at
bug 1362438: More redirects from SCL3 Apache

bug 1362438: py.test asserts for assert_valid_url
bug 1362438: Refactor locale redirects

Add helper function to explicitly set locale_prefix and prepend_locale
to False for "regular" redirects, to avoid matching on non-locale

Add helper function locale_redirect to set locale_prefix to True, and
default prepend_locale to True. Adjust locale redirect patterns to rely
on locale matching in redirect_urls library.

The /Learn topic has moved to /docs/Learn, but this redirect is
enforced in Apache rules. Adding a TODO to change the redirect after AWS

Adjusted some test patterns to use valid locales, so that tests will
pass against Apache in SCL3 and locally.
Merge pull request #4231 from mozilla/dp_apache_redirects_part_2

Bug 1362438: additional redirects from SCL3 Apache to Django

Comment 4

a year ago
I've analyzed the remaining redirects and Apache rules in:

Some of the work will be done on this bug:

* Remove redirect rules for index.php, and return 404s. Over 90% are requests for recent changes RSS. These requests redirect to 404s or "Create a new page" (if logged in). We have new feeds [1], but I don't see any value in making these broken links suddenly work after 5-6 years. The remaining index.php requests are search bots refreshing old MediaWiki or DekiWiki links, or security scanners looking for Joomla or WordPress.
* Remove serving rules for patches, web-tech, and css. These served files that appear to have been created in 2009-2010, which are now no longer available.
* Redirect /contests to
* Redirect /es4 to

Other work will be done under bug 962148, to change some legacy locale URLs to redirects rather than serving the same content.

Assignee: nobody → jwhitlock
See Also: → bug 962148

Comment 5

a year ago
Commits pushed to master at
bug 1362438: Drop legacy index.php redirects

All of these redirects appear broken. Looking at the URLS:

* 90% are for the recent changes RSS feed from MediaWiki days (2009).
* 6% are requests for legacy pages, mostly from search engine crawlers
* 4% are "sniffing" attempts, looking for a Joomla or other site

None are from internal referrers.
bug 1362438: Drop legacy file serving

These paths (patches, web-tech, css) appear to have been active around
2008/2009, but are no longer served from SCL3. Instead, return a 404.
bug 1362438: Update legacy contests redirect

This appears to be for the 2007/2008 Extend Firefox contests:

Update redirect to the archived Mozilla Labs page.
bug 1362438: Redirect the es4 requests

ES4 was the effort to specify the next version of JavaScript
(ECMAScript 4). It appears Mozilla hosted the wiki, or an archive of it,
at one time. Redirect to the ECMAScript task group.
Merge pull request #4381 from jwhitlock/legacy-paths-1362438

bug 1362438: Change handling of some legacy paths

Comment 6

a year ago
Fix pushed to production and stage. There are now either duplicate redirects in Apache and Kuma, or the Apache rule has been removed and now Kuma handles the redirect.
Last Resolved: a year ago
Resolution: --- → FIXED

Comment 7

a year ago
Commits pushed to master at
bug 1362438: add views for aws

* add views and tests for kuma and kumascript revision hashes
* add views and tests for sitemaps
Merge pull request #4401 from escattone/views-for-aws-1362438

bug 1362438: add misc views for aws
You need to log in before you can comment on or make changes to this bug.