Welcome Guest, Not a member yet? Register   Sign In
How to make a URL like this
#1

[eluser]robert.dejesica[/eluser]
Hi guys I want my url to become look like this domainname.com/20202.html

Where 20202 is the item ID.

Any help appreciated.
#2

[eluser]Colin Williams[/eluser]
Code:
$route['(:num)'] = "controller/function/$1";

That very example and others at http://ellislab.com/codeigniter/user-gui...uting.html
#3

[eluser]metaltapimenye[/eluser]
..as addition from Mr Colin Williams suggestion..


Code:
//application/config/config.php

$config['index_page'] = "";      #<--removing index.php in your url
$config['url_suffix'] = ".html"; #<--adding suffix in your url

..so when you use URL Helper..
Code:
echo anchor('20202', 'product title');
..would produce:&lt;a href="http://domainname.com/20202.html"&gt;product title&lt;/a&gt;..automaticly
#4

[eluser]robert.dejesica[/eluser]
Thanks Smile




Theme © iAndrew 2016 - Forum software by © MyBB