php - how to make codeigniter dynamic url search engine friendly -
question: how make codeigniter dynamic url search engine friendly?
example: 1
my current url: after selecting menu called "articles"
http://localhost/lw_user/home_control/getmenu/52
expected url:
http://localhost/articles
example:2 my current url: after selecting sub-menu called "thehindu" under menu "articles"
http://localhost/lw_user/home_control/getpage/6
expected url:
http://localhost/articles/thehindu
note: dynamic url , contents fetching database
what talking called slug
.
so, how use slug?
will explain example:
url - http://www.example.com/products/apple-iphone-5s-16gb-brand-new/
1) assuming having product page , ofcourse product page needs data url understand product display.
2) before querying our database using id getting url. we'll same thing (querying our database) replacing id slug , thats it!
3) hence adding additional column in database named slug. below updated product database structure (just example).
columns values id (int(11), pk) 1 title (varchar(1000)) apple iphone 5s 16gb slug (varchar(1000)) apple-iphone-5s-16gb-brand-new price (varchar(15)) 48000 thumbnail (varchar(255)) apple-iphone-5s-16gb-brand-new.jpg description (text) blah blah ... ...
i've answered on slug before. check if helps.
how remove params url codeigniter
codeigniter - seo friendly url structure (slug implementation)
Comments
Post a Comment