• CodeIgniter website does not work correctly.

  • Requesting non existent php file like results in an entry in /var/www/vhosts/

    [Wed Aug 24 11:04:45.893616 2016] [proxy_fcgi:error] [pid 10954] [client] AH01071: Got error 'Primary script unknown\

    Instead of 404 error.


This is a default behavior of apache + nginx.


Add the rewrite rule into /var/www/vhosts/ in order to check the file before sending it to php handler. The following rewrite rule checks if the requested file exists and returns index.php page if no.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]

More information regarding rewrite rules could be found at apache official web site.



最后修改:2017 年 07 月 27 日 06 : 26 AM