remove parameter from url |
[eluser]fdqepd[/eluser]
Hi, i have a website with a bunch of static pages, so i made a controller that takes care of them Code: <?php i send the title in the url as a parameter like this Code: href="/filename/title" it works just fine, but i cant figure out how to de the following: i want my url to be 'www.site.com/title' instead of 'www.site.com/filename/title', also i need to deal with special charactes like á, ñ, etc in the title. can anybody help me out? thanks
[eluser]kyleect[/eluser]
Use routes. Also, I created a controller for this as well. Here is mine in case you want to use it: Set the route like this: Code: $routes['static_page'] = 'pages/static_page'; so http://localhost/static_page loads http://localhost/pages/static_page Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]fdqepd[/eluser]
Ive managed to set nice ulrs with url_title() using it like this Code: <a href="/grupo/<?= url_title('Ladrón que roba a ladrón'); ?>"> but y want it tho display with special characters in the title... clean for the url but ugly for titles, how can i accompllish that?
[eluser]fdqepd[/eluser]
@kyleect thanks! i will try your controller and see what happens bye |
Welcome Guest, Not a member yet? Register Sign In |