I have reviewed the previous headings, but I do not fully understand and I can not fully do this remove php extension from url, the file is automatically downloaded when I try to do it like the other headers about remove extension I know these code are wrong.
im using NGINX
Please help me with this :
- I mean : www.example.com/index.php
- I want : www.example.com/index
My code :
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name 45.**.91.84;
location / {
try_files $uri $uri/ /upload.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}