There are files * .php.

It is necessary to make it so that in the browser line there are URLs of the * .html type, but so that everything works just as well.

    3 answers 3

    if($_SERVER['REQUEST_URI'] == "/index.php") header ("Location: /index.html"); или в .htaccess Redirect 301 /index.php http://адрес сайта/index.html 

    Ask the correct question, get the correct answer.

    • I'll put you a plus sign) the right decision will be lower. - Vitaly Kustov

    Create a .htaccess file and add it there:

     RewriteEngine on RewriteRule ^(.*)\.html $1\.php 

    The rewrite module must be enabled on the server. This is in case you are using Apache.

    • I had it written before you. The bottom line is that when you enter /index.php there should be a redirect to index.html. The user should see site.ru/index.html, but he should work out the index.php file - Vitaly Kustov
     RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(favicon.ico) RewriteRule ^(.*).html$ $1\.php [L,C] RewriteRule ^(.*).php$ $1\.html [L,R=301] 
    • one
      I will answer with a plus sign of course, but the author’s comment on the first answer to so many is dispersed with the question itself that guess what exactly it needs) - Palmervan
    • OK. just urgently needed. in a hurry I could not clearly express my thoughts. I beg your pardon. I will correct) - Vitaly Kustov