• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pssing parameters to website base url

#1
[eluser]n1c0[/eluser]
Hello everybody, I cannot figure out a clean solution to achieve this result: when somebody enters a url like
Code:
www.example.com/this-controller-does-not-exist
the website treats it like the parameter of a certain controller
Code:
www.example.com/specified-controller/this-controller-does-not-exist
without visually changing the url

I tried some _remapping and things like that, but without any success.
What's the best way to achieve this result?

Thanks a lot!
Nico

#2
[eluser]Mr. Pickle[/eluser]
Set the 404-route in the /config/routes.php file.
Let's say the specified controller is somecontroller you can do.
Code:
$route['404_override'] = 'somecontroller';

From there on you should be able to pick it up further within the somecontroller controller.

#3
[eluser]n1c0[/eluser]
I tried that before. Don't know what it went wrong about it.
Now I tried again and it worked like a charm: thanks for the help!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.