Welcome Guest, Not a member yet? Register   Sign In
Entering only from route address
#11

[eluser]kostyak[/eluser]
And if you make additional rules in route:
1.
Code:
$route['myclass/myfunction']='';
i have tried and it opened my index page
2.
Code:
$route['myclass/myfunction']='unreal_controller';

i tried it and received an error404-page

I think that will help.
#12

[eluser]Aken[/eluser]
Routes is a poor solution, because unless you direct it to a 404-specific controller, it'll still be a valid URL.

If you're that serious about it, I would add a quick check to the controllers themselves that check the URI, and if it matches the non-routed URL, throw a 404. You can create a MY_Controller with a method inside it to make that as easy as one line in each controller.
#13

[eluser]kostyak[/eluser]
Is this not Route aim to make deal with routes tasks? Why do we need to put some additional code to Controller?
#14

[eluser]Aken[/eluser]
Because a route does not restrict access to a controller, unless it is specifically re-routed to a controller that throws a 404 error. If you want to add logic to prevent the original URL from working, you have to do it in the controller.




Theme © iAndrew 2016 - Forum software by © MyBB