CodeIgniter Forums
routing problem - 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: routing problem (/showthread.php?tid=25960)



routing problem - El Forum - 01-02-2010

[eluser]Aviatrix[/eluser]
Hello , I'm trying to build a short uri service with CI just so i can learn CI faster
anyway .. i got stuck at the routing
i hid the index.php then added the following route
Code:
$route['([A-z0-9]{4})'] = "/forward/redirect/$1";

but it just shows my default controller

i also tried with htaccess
Code:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-z0-9]{4})$ /forward/redirect/$1 [NC]
it gives error for not having any passed data
any help is appreciated.
Cheers


routing problem - El Forum - 01-04-2010

[eluser]Sean Gates[/eluser]
I haven't tested it, but try to remove the leading "/" from the forward like this:

Code:
$route['([A-z0-9]{4})'] = "forward/redirect/$1";



routing problem - El Forum - 01-04-2010

[eluser]Aviatrix[/eluser]
[quote author="Sean Gates" date="1262644143"]I haven't tested it, but try to remove the leading "/" from the forward like this:

Code:
$route['([A-z0-9]{4})'] = "forward/redirect/$1";
[/quote]

i tested a lot .. the final answer is located here : http://stackoverflow.com/questions/1994199/codeigniter-routing-problem


routing problem - El Forum - 01-04-2010

[eluser]Sean Gates[/eluser]
From the StackOverflow link: it looks like your CI route setting is getting bypassed entirely by the .htaccess, just so you know.