Good day to all, tell me how in .htaccess to make sure that site.ru/page1.html is displayed instead of site.ru/page1. I watched how to do it in a mane 301 redirect, but it didn’t work for me ...

Options +FollowSymlinks RewriteEngine On RewriteBase / # Rewrite www.site.ru -> site.ru -- used with SEO Strict URLs plugin RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^site\.ru$ [NC] RewriteRule (.*) http://site.ru/$1 [R=301,L] #redirect index.php on / RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ http://site.ru/ [R=301,L] RewriteRule ^/page1.html$ http://site.ru/page1 [R=301,nc] 

    1 answer 1

    Var. one

     Redirect 301 /page1.html http://site.ru/page1/ 

    Var. 2

     Options +FollowSymlinks RewriteEngine on RewriteRule ^page1.html$ http://site.ru/page1 [R=301,NC] 
    • Neither the first nor the second option did not work ... yes, I actually did this, so I asked the question here. And here's another question: if I have several pages, then for each one I can write a redirect like that? Can there be any universal method so that the resolution of the document is not output? In the header attached the contents of my .htaccess file can therein where is the problem? - karr
    • For the 1st option you need mod_alias - check. For the 2nd, I fixed a slightly line - I did not need a slash at the beginning. - Sergiks