Closed
Bug 416479
Opened 17 years ago
Closed 16 years ago
[ForumUX] Pretty URLs for forums
Categories
(support.mozilla.org :: Forum, task)
Tracking
(Not tracked)
VERIFIED
FIXED
1.4
People
(Reporter: jason.barnabe, Assigned: paulc)
References
Details
(Whiteboard: sumo_only urlhandling)
Attachments
(2 files, 3 obsolete files)
667 bytes,
patch
|
laura
:
review+
|
Details | Diff | Splinter Review |
21.28 KB,
patch
|
Details | Diff | Splinter Review |
Among the things we could do:
http://support.mozilla.com/tiki-view_forum.php?forumId=1 -> http://support.mozilla.com/forums/support
http://support.mozilla.com/tiki-view_forum.php?forumId=3 -> http://support.mozilla.com/forums/contributors
http://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=1480&forumId=1 ->
http://support.mozilla.com/forums/support/1480
Comment 1•17 years ago
|
||
Not sure if hardcoding a string (e.g. "support") to a forumId (e.g. 1) is a good idea if we want to support l10n in the future. Maybe that would be possible anyway though, by making sure e.g. /ja/forums/support points to a different forumId than /en-US/forums/support?
Even with numbers only, http://support.mozilla.com/forums/1/1480 is way cleaner than http://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=1480&forumId=1
Comment 2•16 years ago
|
||
This would also make it possible to gather locale specific site stats for future localized forums.
Target Milestone: --- → 1.0
Ok, now that we have a bot to link people to forum posts in #sumo, people are complaining because the forum links are so long and wrapping on their IRC client.
This is really doable with an htaccess change, so let's just finalize exactly what we want (personally, I like the /en-US/forums/support notation rather than the /1/ notation) and then I can just write the few lines of htaccess needed for it to be done.
I'd also like /forums/new to link to the appropriate place.
Updated•16 years ago
|
Target Milestone: 1.0 → 1.1
Sigh, I did say I would do this...
Ok:
RewriteRule ^forum/(.+)$ http://support.mozilla.com/%{BROWSER_ACCEPT_LANGUAGE}/
(I'm not completely sure about that one so someone who knows how to deal with browser languages in htaccess should probably help)
RewriteRule ^([^/]+)/forum/support/[0-9]+$ http://support.mozilla.com/tiki-view_forum_thread.php?locale=$1&forumId=1&comments_parentId=$2 [NC,L]
RewriteRule ^([^/]+)/forum/contributors/[0-9]+$ http://support.mozilla.com/tiki-view_forum_thread.php?locale=$1&forumId=3&comments_parentId=$2 [NC,L]
RewriteRule ^([^/]+)/forum/off-topic/[0-9]+$ http://support.mozilla.com/tiki-view_forum_thread.php?locale=$1&forumId=4&comments_parentId=$2 [NC,L]
This would turn http://support.mozilla.com/en-US/forum/support/1480 into http://support.mozilla.com/tiki-view_forum_thread.php?locale=en-US&comments_parentId=1480&forumId=1
Doing the reverse is a little tricky (that is turning http://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=1480&forumId=1 into http://support.mozilla.com/en-US/forum/support/1480 so that the link is more bookmarkable and tracked by omniture, I'll work on it)
Sigh, I overwrote something screwy in my first one:
RewriteRule ^forum/(.+)$ http://support.mozilla.com/%{BROWSER_ACCEPT_LANGUAGE}/forum/$1 [NC]
Looking at .htaccess on sumo_tools, I probably have to put a lot more thought into not overwriting /forum/ and the like. I'll squint at it some, and test lots and come back with a proper patch.
Comment 7•16 years ago
|
||
Don't sweat it, Cheng. You have more important things to work on. ;)
Assignee: cwwmozilla → nobody
Target Milestone: 1.1 → Future
Comment 8•16 years ago
|
||
My proposed URL "design" would be http://support.mozilla.com/%locale%/forum/x/yyyy, where x is the forum id, and yyyy is the thread id.
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → paul.craciunoiu
Target Milestone: Future → 1.4
Assignee | ||
Updated•16 years ago
|
Summary: Pretty URLs for forums → [ForumUX] Pretty URLs for forums
Assignee | ||
Comment 9•16 years ago
|
||
So I can do this one way -- making sure urls of type http://support.mozilla.com/%locale%/forum/x/yyyy work properly. However, I'd like to rewrite the "ugly" urls to be of this form now. Anyone knows how to do that?
E.g. I want
tiki-view_forum_thread?locale=en-US&forumId=1&comments_parentId=1807
to go to
/%locale%/forum/x/yyyy
The problem I hit on when I tried to do this was looping between this rule and the one that goes the other way.
Assignee | ||
Comment 10•16 years ago
|
||
This adds pretty URLs and rewrite some of the relative paths to images.
Attachment #392783 -
Flags: review?(laura)
Assignee | ||
Comment 11•16 years ago
|
||
This SQL adds two regexes that handle the rewrites for these two pages:
* tiki-view_forum.php
* forum home page (Popular + Recent topics)
We may add subsequent regexes if I missed any listings of forum topics.
Attachment #392784 -
Flags: review?(laura)
Updated•16 years ago
|
Attachment #392783 -
Flags: review?(laura) → review+
Assignee | ||
Comment 12•16 years ago
|
||
r49035 on forumux branch. We'll need to run htaccess.sh and the SQL above. Waiting on Laura's review before filing an IT bug.
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Comment 13•16 years ago
|
||
Comment on attachment 392784 [details] [diff] [review]
SQL to add regexes for forum homepage and forum topic listing
Bit of tidying needed in the second regex as discussed in IRC.
Attachment #392784 -
Flags: review?(laura) → review-
Comment 14•16 years ago
|
||
Waiting on revised regex.
Assignee | ||
Comment 15•16 years ago
|
||
Cleaned up that regex. Also added rewrites for forum URLs (e.g. when viewing forums, not threads).
While I was looking at my dump, I noticed we have a regex that looks like this:
It takes:
^(.+)\?$
to
$1
Am I missing something, why is this useful?
Attachment #392784 -
Attachment is obsolete: true
Attachment #397750 -
Flags: review?(laura)
Assignee | ||
Comment 16•16 years ago
|
||
This updates the code by adding a pref that helps keep the notification library productizable if URL rewrites are not set. It also adds {$tikiroot} in most places to help with the absolute/relative URLs
Finally (and notably), posting a new thread now redirects to the friendly URL (depending on the pref). Reporting a post also. So hopefully users will stay in the friendly realm 100%! :)
Attachment #392783 -
Attachment is obsolete: true
Attachment #397763 -
Flags: review?(laura)
Updated•16 years ago
|
Attachment #397763 -
Flags: review?(laura) → review+
Updated•16 years ago
|
Attachment #397750 -
Flags: review?(laura) → review+
Comment 17•16 years ago
|
||
Comment on attachment 397763 [details] [diff] [review]
patch, v3
I ran into some conflicts applying this. Generating a new patch now.
Attachment #397763 -
Flags: review-
Comment 18•16 years ago
|
||
Conflicts resolved
Attachment #397763 -
Attachment is obsolete: true
Attachment #401241 -
Flags: review?
Comment 19•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 20•16 years ago
|
||
We'll need that run on stage too.
Comment 21•16 years ago
|
||
Verified, FIXED.
Found 4 other bugs related to this one: Bug 518195, Bug 518223, Bug 518209, Bug 518228
Status: RESOLVED → VERIFIED
Comment 22•16 years ago
|
||
The plan is to take this patch as is because none of the bits where pretty urls are missing are critical but to take future patches where we fix them as we find them.
Updated•16 years ago
|
Attachment #401241 -
Flags: review?
Updated•15 years ago
|
Whiteboard: sumo_only urlhandling
You need to log in
before you can comment on or make changes to this bug.
Description
•