Hi,

I'm writing a blog application, which allows me to create new blog post and 
have them listed on a page.

In database, I have a table called "articles" which contains some field 
(id, title, content_text,...).

For now, the URL to access to a specific blog post has the following 
structure :

https://domain.com/blog/readArticle?articleId=23. 

Where :

   - Blog is the controller
   - readArticle() is the function that retrieves the blog article data
   - 23 is the ID of the article in the DB


This is easy to implement, but no user/SEO friendly.

I would like to improve the URL structure to something like:
https://domain.com/blog/readArticle?article=this-is-an-article

or
https://domain.com/blog/this-is-an-article

... and I'm looking for the best way to do this.

Should I modify my backend so that it will search the article based on its 
title (or 'slug').
Or should I use the 'router' in some advanced ways?

I'm sure a lot of people has already done that. Any ideas or suggestions?

Thanks!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to