[RFC] Human Readable URLs

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Locked
User avatar
/a3
Registered User
Posts: 97
Joined: Mon Sep 20, 2010 6:44 am

Re: [RFC] Human Readable URLs

Post by /a3 » Tue Jul 05, 2011 8:13 am

Sam wrote: An example of a redirect:
  1. User clicks an old url:
    http://www.phpbb.com/community/viewtopic.php?f=14&t=2133523
  2. htaccess (which is not aware of anything DB side) will redirect here:
    http://www.phpbb.com/community/f14/t2133523/
  3. User lands on the page, which detects the slugs do not match. It will then direct them here:
    http://www.phpbb.com/community/announcements-f14/phpbb-at-oscon-july-26-28-t2133523/
Comments/Suggestions?
These so called "Human Readable URLs" are simply adding extra information. They are not more human readable because they still contain the number inside of it.
Sam wrote:Keywords in the URL
So is the number. Previously we only had the number in the URL. Adding the keywords apparently makes search engines like you more, for some odd reason. I hope this changes someday.
Sam wrote:User can be clued into where they are going by just looking at the URL
Yes, but this can already be achieved using hyperlinks. If someone really wanted to add extra info to the URL, they could just add an extra ?title=Some_Title to the end of the URL anyway.

Since the suggestion is that slugs which don't match will redirect, a user could easily link to a nasty forum URL but rearrange it so that it uses different words anyway.
$ git commit -m "YOLO"

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC] Human Readable URLs

Post by nickvergessen » Mon Jul 11, 2011 3:07 pm

Well wasn't this one of the things which lead to viewtopic.php?f=84&t=32805 and would be solved when implemented?
Member of the Development-TeamNo Support via PM

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Human Readable URLs

Post by imkingdavid » Fri Jul 29, 2011 10:32 pm

I agree that having "pretty urls" or "clean urls" or whatever the heck you want to call them would be widely appreciated; I can't tell you how many times I've seen requests for it. But as someone who has tried to use them before, it is a nightmare because of the relative links used on the front-end/GUI parts (i.e. style, template, etc.). Of course igorw created a clean URL building class as well as a hook to fix the relative urls and make it all play nicely together, so that could be a way to fix it. But even with that, some servers are very restrictive and some things have to be hardcoded to make it work in some places (even using igorw's fixes, I tried making a MOD with clean urls once that worked nicely on my server but threw up errors on my client's server).

Also, why do we need the "f#" and "t#" stuff? Having the IDs in the URL destroys the point of having a "user friendly" URL. On the new version of my website I have a knowledge base with pretty urls that are in the format of ./kb/category/article and they don't require category or article ids. Each article and each category has its own descriptive title shown on the page and a separate short name (unique among other articles or categories) used in the URL, which acts like an ID with letters instead of numbers. What could be done is simple strip all special characters, spaces, etc. from the topic or forum title and use that as the URL, and if there are conflicts, just add a number at the end and increment for each conflict.

Although, thinking again, what about when a topic is moved? If it is linked anywhere where the link is not dynamically generated (i.e. a post), it will refer to the wrong forum title and ID.

So instead of doing what I just described above, how about having urls like ./phpBB/forum/forum-name and ./phpBB/topic/topic-title.
By specifying "forum" and "topic" before the name of the item, we still don't need to use the ID and if the topic gets moved to a different forum, we don't have to worry about the old forum ID being in the url.

As for memberlist, someone earlier asked about m# or u#... how about just ./phpBB/profile/username (of course the username would have to be stripped of any odd characters, which could result in issues with duplicate names, like user@ and user% would both be "user" in the url, but in that case you could instead supply the user id like ./phpBB/profile/3 or something.

So in summary, it's a nice idea, but might be a nightmare to implement globally since some servers are whiny about such things, and so it should be optional. Also, there needs to be some discussion about implementation as far as how the links should look, etc.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Human Readable URLs

Post by Oleg » Fri Jul 29, 2011 11:44 pm

Anchors are used to scroll to the post in question. They don't affect the content of the page.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Human Readable URLs

Post by imkingdavid » Sat Jul 30, 2011 2:42 pm

Oleg wrote:Anchors are used to scroll to the post in question. They don't affect the content of the page.
Right, but by t# and f# and u# and m# I wasn't referring to anchors, which would have the pound sign in front. I was meaning that we could use phpBB/topic/topic-title instead of forum/topic-title-t39204 and phpBB/forum/forum-name instead of phpBB/forum-name-f32893 so it would use the name of the topic/forum instead of the topic/forum ID in the URL.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC] Human Readable URLs

Post by Oleg » Sat Jul 30, 2011 3:28 pm

As far as I can see you were the first to bring up "t#" and "f#", please explain what they refer to.
Also, why do we need the "f#" and "t#" stuff?
Who said we need or use this and where?

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Human Readable URLs

Post by imkingdavid » Sat Jul 30, 2011 3:55 pm

Oleg wrote:As far as I can see you were the first to bring up "t#" and "f#", please explain what they refer to.
Also, why do we need the "f#" and "t#" stuff?
Who said we need or use this and where?
For instance, in the very first post of the thread, the final url is:
http://www.phpbb.com/community/announcements-f14/phpbb-at-oscon-july-26-28-t2133523/
I'm referring to f14 and t2133523
The # sign simply replaces the numbers. I am proposing removing the f14
So how that URL would look is:
http://www.phpbb.com/community/topic/phpbb-at-oscon-july-26-28
The "phpbb-at-oscon-26-28" acts as a unique identifier in place of the topic ID in the URL. That would need to be added as a new field on the topics table. That would be used to fetch the forum and topic information for that topic.

EDIT: and to view the forum you'd use http://www.phpbb.com/community/forum/announcements
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 135
Joined: Sun Dec 18, 2005 5:44 pm
Location: Texas
Contact:

Re: [RFC] Human Readable URLs

Post by Noxwizard » Sat Jul 30, 2011 4:35 pm

It's so that topics can be renamed/moved without the link becoming invalid. phpBB can pull off the identifier on the end to figure out what forum/topic is being referenced.

User avatar
naderman
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC] Human Readable URLs

Post by naderman » Mon Aug 01, 2011 1:46 am

Instead you can keep a lookup table which contains multiple entries per topic if a topic has been renamed.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC] Human Readable URLs

Post by bantu » Mon Aug 01, 2011 12:46 pm

naderman wrote:Instead you can keep a lookup table which contains multiple entries per topic if a topic has been renamed.
While I do not like the inclusion of t1234 and f123 and friends in the URL, I think that this approach does not work either. It works for CMSes where you can return an error when an URL is already taken and where only a small number of people manage the actual content behind the URLs. But in phpBB different topics can be generated by different people and topics can generally have the same titles, so without the IDs you have nothing that makes the URL unique enough.

Locked