Hello there i am working on web app built with codeignitor where i am suppose to
show the services available withing cities.
For this i am trying to create url like
www.abc.com/mumbai-hotels
where mumbai is city name and hotels is service to be search within city
Now uptill i have following code in my routes.php
file
$route['(about-us)'] = 'websiteController/aboutus';
$route['(:any)'] = 'serviceController/info';
The first line from routes.php suppose to redirect to aboutus
action of webiste controller
.
And second line is suppose to redirect to info action inside the serviceController
.
But unfortunately this is not happening, but it creating conflict and in both case it is still
redirecting to service controller.
Does any one have idea what mistake i am making here, and put me on proper track
2
Answers
suppose url is like following : http://www.paintes.com/painters-in-chennai
then route can be like following
in index.php controller, i’ll be able to receive chennai like following
if url is like http://www.paintes.com/painters-in-mumbai , then output will be mumbai
as per your request, URL is liek following : http://www.paintes.com/mumbai-painters
then you can write like following
You could do something like this :