Codeigniter add url suffix dynamically when search

In the Codeigniter website I have a URL like this www.mywebsitename.com/used-motorbikes, On that page there is form to search location when the user selects location EX: location1 then the URL should change to something like this www.mywebsitename.com/used-motorbikes-location1 is it possible to add like this?

1 Comment

Team CodeForHost (November 7, 2019)

Add logic in client side js to form this URL first. Then redirect window location to this.

In codeigniter make sure you have route added for http://www.mywebsitename.com/used-motorbikes-* and handle it to give needed response.

$route['used-motorbikes-(:any)']

Leave A Comment

What’s happening in your mind about this post !