I'm attempting to remove the .php extension from the URL of my website in the NGINX config. This is my first time using both NGINX and MAMP Pro 6, so forgive me if the answer seems obvious (I'm used to using .htaccess).
Using some answers from this thread, I've attempted:
- Editing the
conffile directly (/Library/Application Support/appsolute/MAMP PRO/conf/nginx.conf). - Editing the template
conffile (File > Open Template > NGINX) - Adding the entire
serverblock to both ofCustom*andAdditional parameters for the server directivefields (attached image for reference). - Adding just the contents of the
serverblock to the same above fields.
This is a fresh project and I haven't modified the NGINX config at all before this.
server {
index index.html index.php;
location / {
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
}
location ~ \.php$ {
try_files $uri =404;
}
}
