Module not working on production |
I follow some tutorials from web and put a module into my application.
Everything works fine on localhost (where the project run into a single folder), but when I send it to server (split it into ci4 and www (public folder)). The home folder works fine, but when I visit site.com/admin for example I always receive 404, but when I run localhost/project/public/admin works fine. app/config/autoload.php PHP Code: public $psr4 = [ app/config/routes.php PHP Code: $routes->group('admin', ['namespace' => 'App\Modules\Admin\Controllers'], function ($routes) { And the httaccess on www folder has the rule (again, on locahost works fine) Code: RewriteCond %{REQUEST_URI} admin Any idea ?
I have shared hosting and mine is public_html. I setup an ftp user and password and just upload everyting to the root
and it just works fine for ftp I use FileZilla. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
@InsiteFX in my case unfortunatelly not work.
But the greate point is the documentation about modules (structure on project) is very simple and give a good direction, but when you go to production, the scenario has differences about the directives. A good point for the documentation about this section is give more information about the server requirements or possiblity of conflicts . In my local machine probably I did some configuration on apache, but on shared hosts not so easy, and probably the answer is on httaccess....
Make sure the folder name is exactly like in Autoload.php (upper/lower case), and the location should be in ROOTPATH, not APPPATH (outside of /app/)
PHP Code: 'Admin' => ROOTPATH . 'Modules/Admin' Make sure you have the right path for your app installation in index.php PHP Code: $pathsConfig = FCPATH . '../your-app/app/Config/Paths.php';
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |