We facing a problem and we can't fix it. We are currently able to run our application as expected - SEO URL runs like a charm and are rewriting to index.php
. The problem is, we have an additional URL Pattern like:
/controllerPrefix/a-param.php
/controllerPrefix/an-other-param.php
/controllerPrefix/an-other-other-param.php
...which we need to rewrite to index.php
too. We are unable to write this URL dynamic URL which ends in .php
. Please note that there are no physical PHP files e.g. a-param.php
-> it's a dynamic pattern which ends in .php
. Unfortunately, the output in browser is File not found.
The following error is logged in nginx 1.10:
FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream...
-> 404 not found
NGNIX Configuration:
server {
listen 80;
index index.php index.html;
root /var/www/public;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
How to rewrite this dynamic URL ending in /controllerPrefix/*.php
to index.php
?