Jump to content
Matt
 Share


IP.Board 3: Friendly URLs at last!

Possibly the most often requested feature we've had since the very first version of IP.Board is 'friendly URLs'.

Although this sounds like you'd expect your URLs to greet you with a self-empowerment phrase first thing in the morning, it really relates to making the board generated URLs a little more attractive to both humans and search engines.

I am being very careful to avoid the phrase "Search Engine Optimization" in this opening few paragraphs despite it being used often in the request for friendly URLs. What we've added will definitely help with SEO but it's not a complete solution and neither is it intended to be.

So, what do you have?
In a nutshell: friendly URLs! The process to create and manage them is far more interesting than the end result, but more on that in a moment. Lets first look at some examples of the new URLs.

Here's a few sample URLs from IPB 2.3.x:

To show a forum (My Test Forum):
www.board.com/forums/index.php?showforum=10

To show a topic (My Test Topic):
www.board.com/forums/index.php?showtopic=99

To show a user (Matt Mecham):
www.board.com/forums/index.php?showuser=30


There's nothing wrong with those URLs. They are short and concise and they spider very well, but we can do a little better to make them more attractive.

If you are on a Windows webserver, you can use the 'query' string method which presents URLs like this:

www.board.com/forums/index.php?/forum/10/my-test-forum
www.board.com/forums/index.php?/topic/99/my-test-topic
www.board.com/forums/index.php?/user/30/matt-mecham


If you are on an apache based web server you can make use of the 'path_info' method:

www.board.com/forums/index.php/forum/10/my-test-forum
www.board.com/forums/index.php/topic/99/my-test-topic
www.board.com/forums/index.php/user/30/matt-mecham


Even better, if you can manage your own .htaccess files, you can make use of the mod_rewrite functionality. For convenience, the mod_rewrite code is generated for you. The end result looks like this:

www.board.com/forums/forum/10/my-test-forum
www.board.com/forums/topic/99/my-test-topic
www.board.com/forums/user/30/matt-mecham


What would happen if you used accented characters like this: M

 Share

Comments

Recommended Comments




Very good. It's much more better solution than "wikipedia conversion":

:D

What would happen if you used accented characters like this: Mått Méçhåm? The are simply converted into their nearest non-accented 'versions'. In this example, "matt-mecham".

M%C3%A5tt_M%C3%A9%C3%A7h%C3%A5m
Link to comment
Share on other sites

lol yeah, wikipedia conversion sucks pretty hard. i had a problem with that... ufff... <_<

Now on topic, great news, hope you guys will get some seo thingy's into IPB3. :) But i guess community seo is there... :D

Link to comment
Share on other sites

May I ask what would happen if someone had matt-mecham, and therefore it couldn't convert to that. In a few of my components, if the users name is accented, I just convert the friendly URL to their ID instead. So your accented name would simply become user/1/ instead of user/conversioncodes.

So yeah, what would happen if someone had the name it tries to convert it to, would it fall back as a last resort onto the user id?

Link to comment
Share on other sites

[quote name='Alεx' date='Sep 18 2008, 12:10 PM']May I ask what would happen if someone had matt-mecham, and therefore it couldn't convert to that. In a few of my components, if the users name is accented, I just convert the friendly URL to their ID instead. So your accented name would simply become user/1/ instead of user/conversioncodes.

So yeah, what would happen if someone had the name it tries to convert it to, would it fall back as a last resort onto the user id?

I may be wrong, but I think that part of the string is just for vanity. IPB would use the user ID anyway, so it would find the correct member even if the matt-mecham bit was shared by someone else.

Link to comment
Share on other sites

The id is always inserted in the url, so the name or descriptive part has to meaning on the actual results. You could put "blah-blah-blah" and it would still come up with the same profile.

A question I have is: With the path info and windows server methods it seems like it takes a string and breaks up the values.. When you do mod_rewrite, are you falling back on GET again? Or have you completely abandoned the use of traditional query strings?

Also with adding the additional values that are not supported with this URL:

www.board.com/forums/topic/99/my-test-topic/_/view/getNewPost

Why couldn't you do something like this:

www.board.com/forums/topic/99/view/getNewPost/my-test-topic

Have the "vanity" part always be last. Is there a way to do that? The "/_/" part just seems a little odd. Or even:

ww.board.com/forums/topic/99/my-test-topic?view=getNewPost

As far as the windows servers, what about ORIG_PATH_INFO? REQUEST_URI is not set by IIS, but you can simulate it like this:

$_SERVER['REQUEST_URI'] = $_SERVER['ORIG_PATH_INFO'] . (isset($_SERVER['argv'][0]) && $_SERVER['argv'][0] != '' ? '?' . $_SERVER['argv'][0] : '');

That way you could make this:

www.board.com/forums/index.php?/forum/10/my-test-forum

Like this:

www.board.com/forums/index.php/forum/10/my-test-forum

To be more consistent with apache (without the mod rewrite).

Also, there are some "mod_rewrite" solutions from IIS (not free). Would we be able to take advantage of these in the same way as apache?

Link to comment
Share on other sites

  • Management

Luke: There are obviously many ways we can do this. The way we've chosen is the simplest and (arguably) most efficient. We will test more extensively on a Windows server during the beta process and fine-tune the system to make it a little more accessible for Windows users.

The system sits on top of the usual query string method, so we've not done away with that. In fact, there are many areas where query strings are still used (and it's OK to do that...)

Link to comment
Share on other sites

Absolutely Fantastic News, this will certainly aid in SERP without jeopdising performance issues with other 3rd party IPB seo modules great. Cheers!

Quick question, I know everything is pretty much possible on the internet - but I wonder if it is easy to achieve the following .(e.g. a few mod_rewrite rules/IPB Template tweaks - with IPS staff help eventually :) )

Making the /forum/ & /topic/ - titles actually say the topic title rather than topic e.g. www.boardname.com/forum/feedback/1023/i_need_feedback/ - as you can see /topic/ is replaced with /feedback/

How hard would that be to achieve please? or even.

www.boardname.com/forum/feedback/i_need_feedback_1023/

Does that make sense?

Link to comment
Share on other sites

  • Management

You can get to a topic by using ANY of the following:

index.php?showtopic=1
index.php?app=forums&module=forums&section=topics&t=1
/topic/1/topic-title

You won't get 404s, etc by switching on the friendly URL feature. IP.Board takes /topic/1/topic-title and converts it into $_GET['showtopic'] = 1;

Link to comment
Share on other sites




Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...