It seems like the $urlRouterProvider.otherwise('/') only works for url which consist 1 segment only i.e abc.com/abcdefg will be redirected to abc.com/ if abcdefg is not defined as part of the state.
But something like abc.com/abc/abcd or abc.com/abc/abcd/abcde/abcdef and so on (url with more than 1 segments ) won't get redirected to abc.com/
Does the $urlRouterProvider.otherwise only works on url with 1 segment only?
managed to resolved this issue. it was a false positive as the issue is on my laravel side. thanks everybody
Related
I am looking for a solution for this code to work with the optional parameter.Indeed placed at the beginning, this parameter is no longer considered optional but I absolutely need to have a solution.
The goal is to archive the old versions of the website by year (it's for a music festival) without having to duplicate all laravel files ...
Route::get('{year?}/lineup', 'HomeController#agenda')->name('agenda');
In this precise case :
/2018/lineup => works
/lineup => not working
Note : I'm using Laravel 5.4
An idea, a suggestion to archive by date the old versions of the site ?
Archives must be accessible online.
Thank you
If you add them in this order it should first check for a match with the year and then for only the lineup. Then it is up to your controller (same for both routes, no extra files needed) to handle the input parameter, if it is set or not.
Route::get('{year}/lineup', 'HomeController#agenda')->name('agenda.history');
Route::get('lineup', 'HomeController#agenda')->name('agenda.current');
I would like to have help with a error I'm are currently having for the Jmonkey Engine 3 and possibly help others if they are getting the same or similar message.
I keep getting this error, when I run/build the project
But when I put the model in the scene composer and go into AnimControl the animations when I play them work. The Code can be uploaded to an Image if requested.
PS : I cannot ask this question on the jmonkey official forms as I have forgetten my password and the rest email will not arrive in my Inbox.
Can you play the other animations (Head Turn for example)? Are you sure that you load the correct model and that you are in the correct position of the Node (the Node, where also the AnimControl is)? Otherwise it has to be a spelling error, for example ldle (with a 'l') instead of Idle (with an 'I').
I want to create location pages in my codeigniter site. So I have one contrller named locations and index method. So all the requests http://mysite.com/location_name should be landed to http://mysite.com/index.php/locations/index. And all other should work as it is like http://mysite.com/login should be landed to http://mysite.com/index.php/home/login. Contact us http://mysite.com/contact-us should be landed to http://mysite.com/index.php/home/contact.
I tried to achieve this by writing following line route rule (route.php):
$route['(:any)'] = 'locations'; //location name can be anything around the world
So locations are working fine, but http://mysite.com/login and http://mysite.com/contact-us are not working, they redirecting continuously in infinite loop.
Please suggest the solution. Thank.
The routes are applied from top to bottom, so you need to have your more specific rules listed first, then your more generic rules last:
$route['login'] = 'home/login';
$route['contact-us'] = 'home/contact';
$route['(:any)'] = 'location/index';
I see that you mentioned you've tried changing the order of rules in your route file. So If you have done this and it's not working - you have something else going on.
I would check these things:
.htaccess file (if you're using it)
controllers that are causing the infinite loop (any redirections in there, _remap method, etc. )
As I read the doc, controllers in CodeIgniter are supposed to support multiple level subfolders, but as far as I have tested, it is impossible to work after first a first level folder.
By example:
mysite.dev/ (index page, default controller home.php, works)
mysite.dev/admin/ (admin section, in admin/home.php, works)
mysite.dev/admin/manage/ (in admin/manage/home.php, do not work)
I am trying to know why and how to make it work on multiple level sub folders?
Thanks in advance!
CI only allows one sub-dir level. However, you can emulate this pattern with routes file as #Brendan says:
Controllers:
welcome.php
admin/admin.php
admin/manage.php
Routes file:
$route['admin/manage/:any'] = "admin/manage/$1";
$route['admin/admin'] = 'admin/home.php';
You can implement some changes to the hardcode to get works as expected: http://codeigniter.com/forums/viewthread/190563/
I am trying to work out the code igniter routing
I have a url that will look like
http://example.com/register
I want that to hit
http://example.com/account/register/normal
I also have
http://example.com/invite/something_random_here
which I want to hit
http://example.com/account/register/invite/something_random_here
I also have
http://example.com/register/something_random_here
which I want to hit
http://example.com/account/register/subscribed/something_random_here
How do I setup these routes?
Pretty much Straight out of the User Guide
$route['register'] = "account/register/normal";
$route['invite/(:any)'] = "account/register/invite/$1";
Basically anything after invite/ will get tacked onto the end of account/register/invite. I believe it only works for one segment, if you want multiple segment support you'll have to use a regular expression:
$route['invite/(.+)'] = "account/register/invite/$1";
Another usefull one (because I believe (:any) only works for characters) would be:
$route['invite/([a-zA-Z0-9_-]+)'] = "account/register/invite/$1";
This will let all alpha-numeric values (single segment) with _ or - go through, great for GUIDs :)
I believe for your first URL, you would use the following route:
$route['register'] = "account/register/normal";
Your second URL, would make use of the following route:
$route['invite/(:any)'] = "account/register/invite/$1";
Both of these routes would need to be placed in your "config/routes.php" file.
Hope this helps?