after adding the rewrite rule the page throws 404 example.com/info/
location / {
rewrite ^([^.]*[^/])$ $1/ permanent;
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
}
However, when I append “.php” to the URL, such as example.com/info.php/, the page loads correctly.
basically what i want to achieve in here is to remove the .php extension and redirect user when they access a URL like example.com/info.php
to example.com/info/
.
What could be causing the 404 error for URLs without “.php” appended, and why does adding “.php” make them work correctly?