Reputation: 515
I want to use codeigniter framework for my project but I dont want it readable, so i have to encrypt url like:
into:
http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw
I dont know how to achieve such scenario. How controller and methods will be called and how it will be performed. Please guide me.
Upvotes: 2
Views: 2052
Reputation: 1585
you can solve this problem by play with: application/config/routes.php
$route['(:any)'] = "controller/myaction/$1";
for more information URI Routing documination
Upvotes: 2
Reputation: 227310
This sounds like a job for URI routing!
Add this to your config/routes.php
:
$route['(:any)'] = "MyController/MyFunc/$1";
Now when you go to:
http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw
it will be "redirected" to:
http://myproject.com/MyController/MyFunc/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw
From there, you can "decode" the URL, and redirect to where you want to go.
Upvotes: 3