nginx extensionless php url without if statement

bukibv

New Member
I use this config:\[code\]root /www/mysite/staticlocation / { try_files $uri @php;}location @php { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /www/mysite/controller$fastcgi_script_name.php;}\[/code\]This will first check if /www/mysite/static has the file. If it can't find the file, then it will run fastcgi on "file.php". Now if I go to www.mysite.com/asdf, it will try to run fastcgi with /www/mysite/controller/asdf.php, which doesn't exist. I read that If statement is evil, so what should I do instead?
 
Top