Permalink
Browse files

wiki: Redirect /help urls to /wiki.

  • Loading branch information...
1 parent 98d0ca5 commit 808b2a4648e1e503c491ae8a2ca25cab125e1244 @rram rram committed Jan 22, 2013
Showing with 14 additions and 7 deletions.
  1. +7 −5 r2/r2/config/routing.py
  2. +0 −1 r2/r2/controllers/redirect.py
  3. +7 −1 r2/r2/controllers/wiki.py
View
@@ -201,10 +201,10 @@ def make_map():
mc('/:action', controller='front',
requirements=dict(action="random|framebuster|selfserviceoatmeal"))
mc('/:action', controller='embed',
- requirements=dict(action="help|blog|faq"))
- mc('/help/gold', controller='redirect', action='redirect', dest='/gold/about')
- mc('/help/*anything', controller='embed', action='help')
-
+ requirements=dict(action="blog"))
+ mc('/help/gold', controller='redirect', action='redirect',
+ dest='/gold/about')
+
mc('/wiki/create/*page', controller='wiki', action='wiki_create')
mc('/wiki/edit/*page', controller='wiki', action='wiki_revise')
mc('/wiki/revisions/*page', controller='wiki', action='wiki_revisions')
@@ -222,7 +222,9 @@ def make_map():
mc('/wiki/*page', controller='wiki', action='wiki_page')
mc('/wiki/', controller='wiki', action='wiki_page')
-
+
+ mc('/:action', controller='wiki', requirements=dict(action="help|faq"))
+ mc('/help/*page', controller='wiki', action='wiki_redirect')
mc('/w/*page', controller='wiki', action='wiki_redirect')
mc('/goto', controller='toolbar', action='goto')
@@ -19,7 +19,6 @@
# All portions of the code written by reddit are Copyright (c) 2006-2012 reddit
# Inc. All Rights Reserved.
###############################################################################
-from pylons import c
from pylons.controllers.util import abort, redirect_to
from r2.lib.base import BaseController
@@ -196,7 +196,7 @@ def check_hidden(page):
pages, linear_pages = WikiPage.get_listing(c.site, filter_check=check_hidden)
return WikiListing(pages, linear_pages).render()
- def GET_wiki_redirect(self, page):
+ def GET_wiki_redirect(self, page='index'):
return redirect_to(str("%s/%s" % (c.wiki_base_url, page)), _code=301)
@base_listing
@@ -259,6 +259,12 @@ def pre(self):
else:
c.wikidisabled = True
+ # Redirects from the old wiki
+ def GET_faq(self):
+ return self.GET_wiki_redirect(page='faq')
+
+ GET_help = GET_wiki_redirect
+
class WikiApiController(WikiController):
@wiki_validate(VModhash(),
pageandprevious=VWikiPageRevise(('page', 'previous'), restricted=True),

0 comments on commit 808b2a4

Please sign in to comment.