CodeIgniter Forums
about rewrite url in codeigniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: about rewrite url in codeigniter (/showthread.php?tid=44119)



about rewrite url in codeigniter - El Forum - 08-04-2011

[eluser]Unknown[/eluser]
Hello everybody, i have a question about rewrite url.

My link is:

Code:
http://web.com/index.php/product/show/1

I want to rewrite:

Code:
http://web.com/laptop/1

How can i do that? Thanks for your help


about rewrite url in codeigniter - El Forum - 08-04-2011

[eluser]cpass78[/eluser]
remove index.php
http://ellislab.com/codeigniter/user-guide/general/routing.html

reroute
http://ellislab.com/codeigniter/user-guide/general/urls.html


about rewrite url in codeigniter - El Forum - 08-04-2011

[eluser]Unknown[/eluser]
My .htaccess file is;
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I insert this line into config/routes.php:

Code:
$route['laptop/(:any)'] = "product/show/$1";

not work, what problem is? Thanks


about rewrite url in codeigniter - El Forum - 08-04-2011

[eluser]danmontgomery[/eluser]
[quote author="mr.hongphuoc" date="1312491112"]not work[/quote]

maybe you can be more specific...?