Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - 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: Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) (/showthread.php?tid=79654) |
Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - MTR2021 - 07-15-2021 [b]Hi Dear Codeignite Community i am newbie in Codeignite coding so i hope you guys give me the time to fix this error thanks is advance [/b]
Code: <IfModule mod_rewrite.c> But the problem is i followed every single tutorial here in codeignite forum on disabling the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ show in my URL i want a clean url directly with no controller name or the ? mark in it i tried going to my routes.php to change things in it following tutorials but still same issue remains here is how my routes.php looks like right now
Code: */ RE: Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - MTR2021 - 07-15-2021 Please admin or anyone help me i am waiting on someones help and answer RE: Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - manager - 07-15-2021 For example you have a controller with name AuthController and a method showLoginPage which is used to show login page. So you don't want url like example.com/authcontroller/showloginpage, but want it be like: example.com/login which should show login page. To do this at first disable auto discovery functionality in Routes file: $routes->setAutoRoute(false); After add this route to your routes file inside App/config folder: $routes->group('', function ($routes) { $routes->get('login', 'AuthController :: showLoginPage'); }); RE: Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - MTR2021 - 07-16-2021 I want to disable the name of the controller from URL like /?home/ or /?browse/ and every single controller like /?admin/ show in my URL i want a clean url directly with no controller name or the ? mark my controllers are Home, Admin, Browse, General, Payment, Updater can you give examples with them exactly so i can try please to fix the problem according to my controllers |