I’ve already looked at a lot of resources on configuring .htaccess for different purposes, one question remains

how should a working .hta file look like? as I understood the principle of such -

<IfModule нужный_модуль> Интересующие опции модуля </IfModule> 

but how then should a simple 301 redirect look? Just a line like

  Redirect 301 / http://yoursitename.ru/ 

or should it be included in any module? I can not understand this. And is it necessary in the .htaccess configuration to point to the module if it is connected in the Apache config itself?

    1 answer 1

    The <ifmodule> check must be done so that the Apache does not fall out with errors, in which case. Or for standardization and scalability of configurations (for example, if you can have two different modules connected and only one of them can work). Therefore, the main part can change, and additional configs remain unchanged.

    If my memory serves me, a redirect of this kind is part of the standard Apache server functions.