How to make my codigniter url seo friendly.
this is my url
http://localhost/picker2/web/search?category=doctor
i want url like this
How to make my codigniter url seo friendly.
this is my url
http://localhost/picker2/web/search?category=doctor
i want url like this
3
Answers
read this article http://www.askaboutphp.com/58/codeigniter-mixing-segment-based-url-with-querystrings.html
to create url like this : http://heloo.com/article/codeigniter-based-url
add this code in routes.php
description :
Actually you have two options
1) Using Routes (this one already denyptw discussed right ?)
2) use the URL Helper url_title function
Note : You can use Parameter instead of query string
http://localhost/picker2/web/search?category=doctor
http://localhost/picker2/web/search/doctor/
web controller , search function , doctor parameter
example :
You need Example of URL Helper
check this link Codeigniter URL: How to display id and article title in the URL
as a simple trick.(Using Controllers)
each and every page create a controller. (ex: if contact create
contact
controller, if product createproduct
controller.) So each and every link will be look like(if you click product)www.example.com/product
,(if you click contact)www.example.com/contact
.If you want something to do with your product then write that method inside the product controller.(ex if you create cart then URL show
www.example.com/product/cart
)