Closed Bug 563995 Opened 14 years ago Closed 14 years ago

Rewrite for Kitsune discussion forums

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jsocol, Assigned: jsocol)

Details

Attachments

(1 file, 1 obsolete file)

RewriteRule ^forums(.*) /k/forums$1 [L,QSA]
RewriteRule ^([\-A-Za-z]+)/forums(.*) /k/$1/forums$2 [L,QSA]

We'll also need to add some actual re*directs* from /en-US/forum/{3,4,5} to their new equivalents once we do the big migration, but this is enough to start testing.

(In general, the format above is what we should use for each app, for now. We'll eventually be able to drop them and just set the WSGIScriptAlias to /, but until then, this allows apps to manage their URLs inside their own urls.py.)
This rewrites anything that starts with /forums or /%LOCALE%/forums to Kitsune, so the whole, pretty URL structure of /%LOCALE%/forums/slug/id will just work.

I also made search match the forums, to be more future proof in case we decide to add something along the lines of /search/xml or /search/plugin (to generate OpenSearch plugins and/or suggestions for OpenSearch plugins).
Attachment #443684 - Flags: review?(paulc)
Comment on attachment 443684 [details] [diff] [review]
adds the rewrites for discussion forums, and tweaks the search rewrite to match

I should have noticed this earlier, but the previous search patch breaks redirects from within search.php
Is it too late to fix this now and land it in 1.5.4?

E.g. go to:
http://support-stage-new.mozilla.com/search.php
You'll be redirected to the homepage.

After this patch, you'd be redirected to
http://support-stage-new.mozilla.com/en-US/search.php
... which shows a 404 (locally).

The forums part, however, works fine, so nothing needs to change there.
Attachment #443684 - Flags: review?(paulc) → review-
The extra line tells Apache not to apply any other rewrites to /search.(php|xml). This should solve the issue.
Attachment #443684 - Attachment is obsolete: true
Attachment #443786 - Flags: review?(paulc)
Comment on attachment 443786 [details] [diff] [review]
exempts /search.(php|xml) from rewriting

This looks good now, with one exception: it breaks the trailing slash fix we had previously.
So /search/ throws a 404 after this patch.
(In reply to comment #4)
> So /search/ throws a 404 after this patch.

/search/ now gets sent to Kitsune as-is. Set DEBUG=False so it bounces off our 404 handler.
Comment on attachment 443786 [details] [diff] [review]
exempts /search.(php|xml) from rewriting

Yes, I forgot about that. r+ then ;)
Attachment #443786 - Flags: review?(paulc) → review+
r66914. (Trunk)
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: