i would like to add ".html" to every document ending on "/", except from the homepage.
i have tried some different ways using rewrite and return 301 with nginx but i didn´t not get it working. attached the last version i did, which is doing /*/.html but the second / should not be there.
location / {
try_files $uri $uri/ =404;
return 301 $scheme://$host$request_uri.html;
}
Solution im am looking for:
root: domain.com should be delivered as www.domain.com
files should be redirected (301) to the *.html version
- domain.com/abc/ to domain.com/abc.html
- domain.com/dir1/abc/ to domain.com/dir1/abc.html