Welcome Guest, Not a member yet? Register   Sign In
URL Routing by .htaccess or routes.php
#1

[eluser]Gavin Vickery[/eluser]
Hello,

I'm working on a small app that only has one controller, but several smaller functions within it. By default, CI shows the controller name in the URL. I would like to always use this one controller by default, and only show the function names.

Example:
Controller: main
Function (within main): find

URL:
http://example.com/find (NOT: http://example.com/main/find)

I've got this working via my .htaccess file

Code:
RewriteRule ^(.*)$ /if/index.php/main/$1 [L]

But I don't know if this is the best practice. Should I be using routes? If so, how would I go about doing that? Not sure I fully understand how routes or supposed to work.

Cheers


Messages In This Thread
URL Routing by .htaccess or routes.php - by El Forum - 11-30-2007, 10:10 AM
URL Routing by .htaccess or routes.php - by El Forum - 11-30-2007, 10:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB