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)
support.mozilla.org
General
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.
Comment 1•11 years ago
|
||
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
Comment 2•11 years ago
|
||
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
Comment 3•11 years ago
|
||
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]
| Assignee | ||
Comment 5•11 years ago
|
||
Hey, I can work on this. Just have https://support.mozilla.org/en-US/kb/How%20to%20contribute redirect to https://support.mozilla.org/get-involved, correct?
Comment 6•11 years ago
|
||
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
| Assignee | ||
Comment 7•11 years ago
|
||
:rrosario, :r1cky, how do I find the slug or URL for https://support.mozilla.org/en-US/kb/How%20to%20contribute?
Comment 8•11 years ago
|
||
(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
Comment 9•11 years ago
|
||
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'),
| Assignee | ||
Comment 10•11 years ago
|
||
(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?
Comment 11•11 years ago
|
||
(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
| Assignee | ||
Comment 12•11 years ago
|
||
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)),
Comment 13•11 years ago
|
||
(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'),`
| Assignee | ||
Comment 14•11 years ago
|
||
It loads fine now but I get the "Page not found (404)" page with the error: "No Document matches the given query."
Comment 15•11 years ago
|
||
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.
| Assignee | ||
Comment 16•11 years ago
|
||
Created a pull request: https://github.com/mozilla/kitsune/pull/1939
Comment 17•11 years ago
|
||
Updated•11 years ago
|
Whiteboard: u=user c=wiki p=1 s=2013.backlog [mentor=r1cky] → u=user c=wiki p=0 s=2014.8 [mentor=r1cky]
Comment 18•11 years ago
|
||
Deployed to prod now.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 19•11 years ago
|
||
Thank you :pancakes9!!!
You need to log in
before you can comment on or make changes to this bug.
Description
•