CodeIgniter Forums
Question about routes.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Question about routes.php (/showthread.php?tid=34117)



Question about routes.php - El Forum - 09-20-2010

[eluser]xare[/eluser]
Hello

I am using a jquery plugin that shows all my page navigation as a tabbed browsing system.

The links have this form

http://www.domain.tld/#1
http://www.domain.tld/#2
..........

I have changed the javascript code so we can generate the following urls, so we can be more SEO:

http://www.domain.tld/home
http://www.domain.tld/secondpage
....

In routes.php I have written the rules for redirection:
$route['home']="#1";
$route['secondpage']="#2";

But, for example on the second case Code igniter looks for the secondpage controller and does not redirect. So far for the jquery plugin (coda slider) to work I need the links to be converted to #1, #2, etc.....

How can i check using webdevelopper or firebug addons on firefox if an address is being rewritten ?


Question about routes.php - El Forum - 09-20-2010

[eluser]Pascal Kriete[/eluser]
I think you need to take a step back and make sure that you truly understand what each portion of the code does.

- PHP cannot see the url hash (the part after #), it's only available on the frontend.
- Routes aren't a redirect. Routes are an internal mapping of a url to a controller.