It is necessary that users redirect to the main page, if they go to any link in the section.
For example, site.ru/section/handbook/?id=1231 throws it on the main page.
And site.ru/section/ also throws it on the main one.

I hope explained clearly. I myself do this:

RewriteEngine On RewriteRule /section/(.*)$ / [L,R=301] 

    1 answer 1

    You think correctly. In the given code snippet, there are three errors: an extra slash and extra brackets (because of the slash, your redirect does not work the way you want, and the brackets are simply redundant in this case), as well as the implied but missing ^ symbol, which marks the beginning of the line in the regular expression.

    The correct entry will be:

     RewriteEngine On RewriteRule ^section/.*$ / [L,R=301]