![]() |
URL Manipulation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: URL Manipulation (/showthread.php?tid=2007) |
URL Manipulation - El Forum - 07-11-2007 [eluser]BrandonDurham[/eluser] So is it possible for me to make a url that looks like this: Code: http://www.site.com/index.php/admin/view/entryname look like this: Code: http://www.site.com/entryname If so, how do I go about that? Thank you. URL Manipulation - El Forum - 07-11-2007 [eluser]Glen Swinfield[/eluser] First you need to use .htaccess to remove the index.php then config/routes.php to deal with the routing of the page - something like this: .htaccess: Code: <IfModule mod_rewrite.c> Routes: Code: $route[':any'] = "admin/view"; Put any routes after the default ones - And I'm not sure if this will work anyway - you may have to use Code: $route['view/:any'] = "admin/view"; and have the url http://www.site.com/view/entryname Check the user manual for routing. URL Manipulation - El Forum - 07-11-2007 [eluser]BrandonDurham[/eluser] Ah. That's so close to working! I do have to write it like "view/:any", though. Unfortunately I need it to appear like it's at the root level - not in a "view" folder. URL Manipulation - El Forum - 07-11-2007 [eluser]BrandonDurham[/eluser] Any other suggestions on this? URL Manipulation - El Forum - 07-12-2007 [eluser]Glen Swinfield[/eluser] Sorry - I'm all out on this one. > ![]() |