Kurt Koben Kurt Koben - 3 months ago 20
PHP Question

Rewrite Url in Codeigniter

I want to rewrite this url

http://mywebsite.local/watch/serie/le-transporteur-la-s%C3%A9rie


to

http://mywebsite.local/watch-serie-le-transporteur-la-s%C3%A9rie.html


how i can proceed ?

Answer

You need to make a rewrite condition in the htaccess file and config file Then, in your route file you need to use :

$route['watch-serie-le-transporteur-la-s%C3%A9rie\.html']='folder/controller/method';

or

$route['(:any)\.html'] = 'folder/controller/method';