Welcome! Log In Create A New Profile


From Apache to Nginx - htaccess problem

Posted by xergiopd 
From Apache to Nginx - htaccess problem
February 20, 2017 03:51AM
I'm trying to switch from Apache to nginx, but I'm having trouble with .htaccess, this is the .htaccess

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

and this is the rewrite I configured in ngnix

location ~ \.php$ {
if (!-e $request_filename) {
rewrite ^(.*)$ /web/index.php/$2 break;
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

but when I load the site is returned me this error

2017/02/20 09:17:24 [error] 12058#0: *1 "/html/MYSITE/web/index.php/index.php" is not found (20: Not a directory), client: MYIP, server: MYSITE, request: "GET /phpinfo/ HTTP/1.1", host: "MYHOST"

can anyone help?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 78
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready