Replacing http://www.example.com/class with http://www.example.com/unknown($salt) if a particular class doesn't exist |
[eluser]Azureus[/eluser]
CodeIgniter expects a class after my domain name http://www.example.com/(class). The problem is when my program generates a random key(salt) I want to replace the class name with that salt EX. $salt = "a1b2c3d4" now I want http://www.example.com/$salt. I want http://www.example.com/$salt to redirected(maybe with .htaccess) to http://www.example.com/class/function/$salt without changing the url maybe with curl. So I want http://www.example.com/$salt to show whatever http://www.example.com/class/function/$salt is showing. I can't afford to use http://www.example.com/class/function/$salt directly because of its length so I must use http://www.example.com/$salt. My first thought was about using .htaccess file then using URI routing then using a hook. Can anyone give me any suggestions on how to do this and what to use? Thanks.
[eluser]pistolPete[/eluser]
I'd recommend routing: routes.php Code: // first route (1): http://ellislab.com/forums/viewreply/540633/ Using this method you have to explicitly route every controller and put these routes before the :any route.
[eluser]Azureus[/eluser]
To pistolPete's post... Is there a way I don't have to rout my controllers? Is there a way to check if the controller exists first then if not send a unique to a known controller?
[eluser]pistolPete[/eluser]
Quote:Is there a way to check if the controller exists first then if not send a unique to a known controller?That is exactly what routing does. Why do you want something else than routing?
[eluser]Azureus[/eluser]
The problem is I have many controllers and it's tedious to reroute every new controller.
[eluser]pistolPete[/eluser]
Did you have a look at this helper function? forums/viewthread/51740/#261261 |
Welcome Guest, Not a member yet? Register Sign In |