H
H
HankeTM2018-04-16 17:24:53
Nginx
HankeTM, 2018-04-16 17:24:53

How to make a correct redirect to .html?

Good day!
There is a site on Joomla. Previously, it was located on a server with Apache, then it was transferred to Nginx + PHP-FPM and, naturally, rewrites had to be rewritten ...
In general, now pages are duplicated by URLs with .html at the end and without .html , I wrote this line: rewrite ^(. *?/.*[^.html])$ $1.html permanent; .
I thought that the problem was solved) But, the following problem appeared: .html is added everywhere (I mean style files, plugins, admin area, etc.)...
Can someone tell me what is not taken into account in this line? I can't understand, I'm not an expert in this matter.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2018-04-17
@BorisKorobkov

Option 1. Do
the opposite: do not add, but delete ".html" Option 2. List all other extensions in a regular expression or generally simplify "if it does not contain a dot":^(.*?/[^\.]+)$

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question