title: Remove file extension and keep parameters on nginx
body: <p>I'm trying to make url on my server seo friendly.</p>
  <p>Original: /face.php?name=hello-stackoverflow123</p>
  <p>Desired: /face/hello-stackoverflow123</p>
  <p>I made those little configs:</p>
  <pre><code>    location / {
          try_files $uri $uri.html $uri/ @extensionless-php;
          index index.html index.htm index.php;
      }
  
      location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      }
  
      location @extensionless-php {
          rewrite ^(.*)$ $1.php last;
      }
  </code></pre>
  <p><strong>Problem 1:</strong> I can't find a config to keep the parameters it gives me always 404 (so I get 404 if I try face/hello-stackoverflow123</p>
  <p><strong>Problem 2:</strong> If I have a file faces.php it will open if I try/faces, but if I open faces.php it won't redirect to /faces</p>