views:

86

answers:

3

Hello,

I have migrated a old php/mysql site to ruby on rails, and had to keep the old link structure - not to break incoming links.

The structure look like this:
domain.com/artists/user1/seo-friendly-name-of-painting1
domain.com/artists/user1/seo-friendly-name-of-painting2
domain.com/artists/user1/seo-friendly-name-of-painting3
etc.

I thinking about adding a blog to each user-profile. What would be the best structure for adding this new feature? I see two possibilities:

  1. Add the blog as a new main item, and link to the user that owns it. domain.com/blogs/seo-friendly-name-of-blog-title

  2. Add the blog nested under the user: domain.com/artists/user1/blogs/seo-friendly-name-of-blog-title

I am worried about mixing the paintings with with the blogs resource - they will be at the same level. Hope I explained it good enough.

Best regards. Asbjørn Morell

+2  A: 

I think both of them work.

With the second solution, you have to enter 2 params -> userid and blog-id/name

I prefer the first one, because you dont have to deal as much with uncorrect data when chaning the get params, like with the second solution. F.e.

domain.com/artists/wong user 123123/blogs/seo-friendly-name-of-blog-title

would produce another error massage like

domain.com/artists/user1/blogs/wrong blog title
Lichtamberg
A: 

blogs.domain.com/user?...

edit:

if you want to change links structure you can redirect your current links like this

Phil
I don't know about this suggestion.. it kinda feels wrong to add a subdomain :/
atmorell
A: 

You can also design your URL schema as you like and then setup permanent redirections using mod_rewrite in Apache. While it may not be the most maintenable approach, I think it may be valuable if it helps you to come up with cleaner routes in your Rails app.

pantulis
How would you implement this in my example?
atmorell