There is a condition in htaccess - we give code 410 to all pages except those who end in ".html". But now the main one also has a 410 error now, how to add the main page to this condition?

RewriteCond %{QUERY_STRING} !^(.*)\.html$ RewriteRule ^ - [G] 

    1 answer 1

     RewriteEngine On # обратились к файлу, который имеет расширение отличное от .html RewriteCond %{REQUEST_URI} !\.html$ [NC] # и обратились не к корню сайта RewriteCond %{REQUEST_URI} !^/$ # и обратились не к файлу index (с любым расширением) в корне сайта RewriteCond %{REQUEST_URI} !^/index\. [NC] # тогда 410 ошибка в ответ RewriteRule ^ - [G] 
    • for some reason the RewriteCond %{REQUEST_URI} !^/$ condition does not work RewriteCond %{REQUEST_URI} !^/$ Home - 410 - Dmitry Portnov
    • @DmitryPortnov, the old redirect in the browser's cache is not exactly cached? - Visman
    • Yes, I checked everything for sure. I left only this RewriteCond %{REQUEST_URI} !^/$ RewriteRule ^ - [G] It's still 410 on the main one. Maybe it's in cs - modx? - Dmitry Portnov
    • @ Dmitry Portnov, do you have any other rules in .htaccess? If so, in the update question, add below the current text that you now have there. - Visman