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

[eluser]mpar612[/eluser]
Hi Everyone,

I am new to codeigniter and having a difficulty with routing that is driving me crazy.

I have a link in a view that is supposed to take me to http://domain.com/index.php/admin/view/slug, but it takes me to http://domain.com/index.php/admin/admin/view/slug. It add the second "admin/". If I type the direct URL, the routing seems to work fine. Any thoughts would be greatly appreciated. Thanks in advance!

Code:
<a href="admin/view/&lt;?php echo $shop_item['slug'] ?&gt;">View Item</a>

routes.php
Code:
$route['admin/view'] = 'admin/view';
$route['admin/view/(:any)'] = 'admin/view/$1';
$route['admin/update'] = 'admin/update';
$route['admin/update/(:any)'] = 'admin/update/$1';
$route['admin'] = 'admin';
#2

[eluser]TheFuzzy0ne[/eluser]
Routing is transparent. If you can see the URL transformation in your address bar, then it's probably something to do with your .htaccess file or your app redirecting at some point.
#3

[eluser]mpar612[/eluser]
Thanks for the response. My .htaccess file only has "Deny from all"

I don't see my app redirecting anywhere.

Any other thoughts?

Thanks!
#4

[eluser]mpar612[/eluser]
I'm not exactly sure why, but I fixed the issue.

I swapped out the <a> tags with codeigniter's anchor function. Works like a charm.




Theme © iAndrew 2016 - Forum software by © MyBB