G
G
GONJY MONJY2020-08-03 18:47:20
Yii
GONJY MONJY, 2020-08-03 18:47:20

How to set ".html" suffix for all pages in yii2 site at once?

Hello! The essence of the question is this:
let's say there is such a link -> "siteName/site/login".
I want to set the ".html" suffix to it so that it looks like this -> "siteName/site/login.html".
But it should work for all pages. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-08-03
@GONJY_MONJY

Have you looked in the documentation ?

[
    'components' => [
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'enableStrictParsing' => true,
            'suffix' => '.html',
            'rules' => [
                // ...
            ],
        ],
    ],
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question