Closed Bug 927450 Opened 12 years ago Closed 11 years ago

Create redirect for old Get Involved page

Categories

(support.mozilla.org :: General, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2014Q2

People

(Reporter: JasnaPaka, Assigned: scott.leea)

References

Details

(Whiteboard: u=user c=wiki p=0 s=2014.8 [mentor=r1cky])

There was old Get Involved page on URL https://support.mozilla.org/en-US/kb/How%20to%20contribute (see Bug 817358 or Bug 927412). Try to visit this page and you will see 404. Correct behavior is redirect to https://support.mozilla.org/get-involved. We need add such redirect.
Blocks: 927412
Cool URls don't break. I'm not sure whether we can create redirects like this, but if yes, we should just go ahead and do it.
Priority: -- → P4
Whiteboard: u=user c=wiki p= s=2014.5
Target Milestone: --- → 2014Q1
creating a redirect for an old slug is pretty easy.
Whiteboard: u=user c=wiki p= s=2014.5 → u=user c=wiki p=1 s=2014.5
Moving our P4s to the backlog.
Whiteboard: u=user c=wiki p=1 s=2014.5 → u=user c=wiki p=1 s=2013.backlog [mentor=r1cky]
Q1 is over. Bring it on, Q2!
Target Milestone: 2014Q1 → 2014Q2
Scott: That sounds right. I'll assign this bug to you. If you have any questions, let us know, either here on Bugzilla or on IRC in the #sumodev channel.
Assignee: nobody → scott.leea
Status: NEW → ASSIGNED
:rrosario, :r1cky, how do I find the slug or URL for https://support.mozilla.org/en-US/kb/How%20to%20contribute?
(In reply to Scott Lee [:pancakes9] from comment #7) > :rrosario, :r1cky, how do I find the slug or URL for > https://support.mozilla.org/en-US/kb/How%20to%20contribute? We want to redirect "/kb/How%20to%20contribute" to `reverse('landings.get-involved')`. See an example of how to do that here: https://github.com/mozilla/kitsune/blob/master/kitsune/landings/urls.py#L11
Also, the redirect should live in kitsune/wiki/urls.py: https://github.com/mozilla/kitsune/blob/master/kitsune/wiki/urls.py Maybe right below the existing redirect in that file: url(r'^$', redirect_to, {'url': 'products.product', 'slug': 'firefox'}, name='wiki.landing'),
(In reply to Ricky Rosario [:rrosario, :r1cky] from comment #9) > Also, the redirect should live in kitsune/wiki/urls.py: > > https://github.com/mozilla/kitsune/blob/master/kitsune/wiki/urls.py > > Maybe right below the existing redirect in that file: > > url(r'^$', redirect_to, > {'url': 'products.product', 'slug': 'firefox'}, name='wiki.landing'), I tried adding the following to kitsune/wiki/urls.py: --- from django.core.urlresolvers import reverse ... url(r'^kb/How%20to%20contribute$', redirect_to, {'url': reverse('landings.get_involved')}, name='landings.get_involved'), --- and I kept getting the error: "The included urlconf kitsune.urls doesn't have any patterns in it" -- help?
(In reply to Scott Lee [:pancakes9] from comment #10) > I tried adding the following to kitsune/wiki/urls.py: Can you paste the diff or full file? Thanks
My bad -- (for future reference, should I paste it directly here or use something like PasteBin?) git diff kitsune/wiki/urls.py diff --git a/kitsune/wiki/urls.py b/kitsune/wiki/urls.py index 1b73984..bb73c79 100644 --- a/kitsune/wiki/urls.py +++ b/kitsune/wiki/urls.py @@ -1,4 +1,5 @@ from django.conf.urls import patterns, url, include +from django.core.urlresolvers import reverse from kitsune.sumo.views import redirect_to from kitsune.wiki import locale_views @@ -80,6 +81,9 @@ urlpatterns = patterns( url(r'^$', redirect_to, {'url': 'products.product', 'slug': 'firefox'}, name='wiki.landing'), + url(r'^kb/How%20to%20contribute$', redirect_to, + {'url': reverse('landings.get_involved')}, name='landings.get_involved'), + url(r'^/locales$', locale_views.locale_list, name='wiki.locales'), url(r'^/locales/(?P<locale_code>[^/]+)', include(locale_patterns)),
(In reply to Scott Lee [:pancakes9] from comment #12) > + url(r'^kb/How%20to%20contribute$', redirect_to, > + {'url': reverse('landings.get_involved')}, > name='landings.get_involved'), Oh I see. The 'url' parameter should be the name of the url, not the url (result of reverse). So that should be more like: `{'url': 'landings.get_involved'},`. You also need a different name for this url so there is no conflict. I would use something like `name='old_get_involved'),`
It loads fine now but I get the "Page not found (404)" page with the error: "No Document matches the given query."
Ah, I forgot to mention that since you are in wiki/urls.py, you can remove the "kb/" part. Then you need to make sure this url is defined before the url for the document view because otherwise that would take precedence.
Whiteboard: u=user c=wiki p=1 s=2013.backlog [mentor=r1cky] → u=user c=wiki p=0 s=2014.8 [mentor=r1cky]
Deployed to prod now.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Thank you :pancakes9!!!
You need to log in before you can comment on or make changes to this bug.