![]() |
Routes Not Working On Live Host ?!!!!! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Routes Not Working On Live Host ?!!!!! (/showthread.php?tid=79084) |
Routes Not Working On Live Host ?!!!!! - paliz - 04-17-2021 hello guys i have problem with Route on real host .every thing work well on localhost but on live host my routes didnt work here my code ? help ci4 funs PHP Code: <?php RE: Routes Not Working On Live Host ?!!!!! - includebeer - 04-17-2021 Maybe not the cause of your problems, but you should probably disable AutoRoute: PHP Code: $routes->setAutoRoute(false); Is your file structure the same on local and live host? (public directory...?) RE: Routes Not Working On Live Host ?!!!!! - paliz - 04-18-2021 (04-17-2021, 04:23 PM)includebeer Wrote: Maybe not the cause of your problems, but you should probably disable AutoRoute: (04-17-2021, 04:23 PM)includebeer Wrote: Maybe not the cause of your problems, but you should probably disable AutoRoute: I didnt change structure I try acesss like that Www.exmple.com/public/api/auth/login Login method is POST request is not working but Logout method is GET request is working When setautorute to false still i got error too either RE: Routes Not Working On Live Host ?!!!!! - includebeer - 04-18-2021 You're not suppose to have the public folder visible like that. That probably means that all the other folders that are supposed to be outside the document root are not. RE: Routes Not Working On Live Host ?!!!!! - paliz - 04-18-2021 (04-18-2021, 05:47 AM)includebeer Wrote: You're not suppose to have the public folder visible like that. That probably means that all the other folders that are supposed to be outside the document root are not.Look dude i have two apps frontend angular 11 which index. Html(root to path www/index. Html) backend ci4 index. Php (root to path www/public/index. Php) See backend and fronend are seprate it its full stack app On local host i access shell cmd Can run php spark serve then init https://localhoat:8080 but live host i dont acess shell cmd I got this path www.exmple.com/public/ Then can call restfull controllers okey RE: Routes Not Working On Live Host ?!!!!! - includebeer - 04-18-2021 If CI is only used as backend, you should probably set a subdomain like api.example.com and have your backend (CI) and frontend (Angular) separated with their own domain. The public folder is your document root, it should not be inside the document root with all other files. And don't tell me "look dude" like I'm stupid. You didn't even mention you had 2 separated apps for the front and back. RE: Routes Not Working On Live Host ?!!!!! - paliz - 04-18-2021 (04-18-2021, 06:57 AM)includebeer Wrote: If CI is only used as backend, you should probably set a subdomain like api.example.com and have your backend (CI) and frontend (Angular) separated with their own domain. The public folder is your document root, it should not be inside the document root with all other files. And don't tell me "look dude" like I'm stupid. You didn't even mention you had 2 separated apps for the front and back.Oky my friend i didnot mean anthing about using dude in post sorry about it angular its not in Document root(public folder) it s in upper folder there is no conflict between two index . ci4 version 4.0.4 dose have problem since i use 4.1.1 i got error on live host RE: Routes Not Working On Live Host ?!!!!! - paliz - 04-21-2021 (04-18-2021, 06:57 AM)includebeer Wrote: If CI is only used as backend, you should probably set a subdomain like api.example.com and have your backend (CI) and frontend (Angular) separated with their own domain. The public folder is your document root, it should not be inside the document root with all other files. And don't tell me "look dude" like I'm stupid. You didn't even mention you had 2 separated apps for the front and back. you ware rright man it needs subdomain api.example.com vi4 upload in subdomain then upload angular app exmple.com now every thing okay RE: Routes Not Working On Live Host ?!!!!! - includebeer - 04-21-2021 Cool, thanks for letting us know it’s now working! ![]() |