Welcome Guest, Not a member yet? Register   Sign In
routing problem
#1

[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
#2

[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";
#3

[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/19941...ng-problem
#4

[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.




Theme © iAndrew 2016 - Forum software by © MyBB