I looked at the suggested answer(possible duplicate as stakoverflow says). It provided help but didn’t solve the problem as it won’t help create clean URL as per my needs. It has controller as part of the URL which I don’t want to see as mentioned below.
I am developing a tutorial site in Codeigniter, and looking for a way to generate SEO friendly URL like
www.crdlabs.com/how-to-use-multidimensional-arrays
instead of
www.crdlabs.com/home/index/how-to-use-multidimensional-arrays
.
Can anyone share his ideas? Thank you
2
Answers
First you need to hide the index.php from URL so create the .htaccess file on the root folder and add this code
.htaccess
Then open the routes.php file in the application/config/routes.php location
and add this
This will work as URL as SEO friendly
Add this to ur root .htaccess file :
Then in ur index.php get the title $title = $_GET[‘title’] and do what ever you like with it like do a query in ur database and return data based on the title !