I want my nginx make display all url's clean.
- http://www.mydomain.com/indexhtml.html as http://www.mydomain.com/indexhtml
- http://www.mydomain.com/indexphp.php as http://www.mydomain.com/indexphp
With some research I've made the first case to work. It`s done by following configuration:
location / {
root html;
index index.html index.htm index.php;
try_files $uri.html $uri/ =404;
}
It works for indexhtml.html displaying as indexhtml, but nothing happens with .php. If I change $uri.html to $uri.php, it works neither for .html, neither .php. I`ve tried to put something similar in php location but without any success.
Any advices?
s only for example to understand, that I
m not an weirdo, whos having both index.php and index.html files on my server. However, it
s already solved. – Lichen