• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Problem with nginx and codeigniter routes

DarkKikies

Basic Pleskian
I developed a small cms with codeigniter and in local use xampp * * works perfectly.

When I put on my vps plesk mounting nginx and I had problems with the controller.
They are not read.

Every link I post except that automatically reads codeigniter and the default I return a 404 error.

Schermata 2015-06-12 alle 13.31.51.png

If you read the thread I opened on the forum of CI http://forum.codeigniter.com/thread-62112.html

You will realize that I have tried a lot 'of configurations but none has been good for me.

I beg you, you help me solve the problem?

P.S. on vps I have several active domains.

My controller is:
PHP:
$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['page/(:any)'] = 'page/thread/$1';
$route['translate_uri_dashes'] = FALSE;

$route['acp'] = 'acp/user/login';
$route['acp/page/edit/(:any)'] = 'acp/page/edit/$1';
$route['acp/page/delete/(:any)'] = 'acp/page/delete/$1';
$route['acp/menu/edit/(:any)'] = 'acp/menu/edit/$1';
$route['acp/menu/edit/(:any)'] = 'acp/menu/delete/$1';
 
Last edited:
I developed a small cms with codeigniter and in local use xampp * * works perfectly.

When I put on my vps plesk mounting nginx and I had problems with the controller.
They are not read.

Every link I post except that automatically reads codeigniter and the default I return a 404 error.

View attachment 9819

If you read the thread I opened on the forum of CI http://forum.codeigniter.com/thread-62112.html

You will realize that I have tried a lot 'of configurations but none has been good for me.

I beg you, you help me solve the problem?

P.S. on vps I have several active domains.

My controller is:
PHP:
$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['page/(:any)'] = 'page/thread/$1';
$route['translate_uri_dashes'] = FALSE;

$route['acp'] = 'acp/user/login';
$route['acp/page/edit/(:any)'] = 'acp/page/edit/$1';
$route['acp/page/delete/(:any)'] = 'acp/page/delete/$1';
$route['acp/menu/edit/(:any)'] = 'acp/menu/edit/$1';
$route['acp/menu/edit/(:any)'] = 'acp/menu/delete/$1';
I haven't used CI, but unless you've specified nGinx to parse php on that domain, I'm not sure it's going to work at all. In any case, make sure the correct settings are specified in the "Additional nginx directives" configuration in Web server settings for the domain in question. Moreover, try to see if Apache is parsing the CI page you're interested in.
 
Sisi, I know where to place the additional configuration for the domain, thanks. :)

I tried to disable nginx to operate only apache, but I have the same problem. Yet everything works on xampp perferzione.


I want to specify that 'acp' routes is in a folder located inside of the controller.
While page is only the name of the controller.
 
Sisi, I know where to place the additional configuration for the domain, thanks. :)

I tried to disable nginx to operate only apache, but I have the same problem. Yet everything works on xampp perferzione.


I want to specify that 'acp' routes is in a folder located inside of the controller.
While page is only the name of the controller.
Ok, if it's just a test then, why not delete and re-create it? You can also try to re-configure it using Plesk's CLI:
Code:
"%plesk_bin%"\websrvmng --reconfigure-vhost –vhost-name=domain.com
 
I would try to solve the problem without reconfigure anything.

Configuration is clean without any change and it all works normally.

I would just solve this problem with a configuration nginx or something...
 
Back
Top