G
G
grechinaoleg2015-10-16 18:12:10
Nginx
grechinaoleg, 2015-10-16 18:12:10

How to make a redirect in nginx so that at the end of each link there is .html?

Good day to all!
Now all pages of the site are available at the following addresses
site.ru/6-klass
site.ru/6-klass
site.ru/6-klass/.html
site.ru/6-klass.html
site.ru/6-klass.htm
And in general, it is available at all addresses where there is at least something after the dot, for example like this:
site.ru/6-klass.asd
site.ru/6-klass.sadjsakljdksa
site.ru/6-klass/.sadjsakljdksa
How to do to redirect to addresses with .html at the end, or give 404 to all pages without .html
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton B, 2015-10-16
@bigton

You at least need to show the current config.
But I think the solution is not in nginx, you need to look towards the CMS router.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question