Htaccess - php analysis in html

I recently played with a file .htaccessso that one server parses PHP files. Yesterday I uploaded the same file .htaccessand tried to test the PHP file. But something went wrong: visiting my page, the browser offers to download the html page, and not view the page!

On the server, file names end with .html.

.htaccessI added the following to the file :

AddType application/x-httpd-php .html

I tried to find the htaccess file, but after downloading it, it just disappears from the root directory. I tried to load other scripts that I found in the browser. I even tried to find some kind of problem on the forum hosting. Nothing helped. Please, help!

+3
source share
2 answers

try it

AddType application/x-httpd-php .php .htm .html

OR

AddHandler application/x-httpd-php .php .htm .html

application/x-httpd-php .

+5

, -, -, ?

ftp ? , ., .htaccess .htpasswd, , . , , .

, .htaccess , allowoverride ; URL ( mod_rewrite), .

rewrite .htaccess :

RewriteEngine On
RewriteBase /
RewriteRule ^(\w+)\.html$ $1.php [NC] 

( ) , php, URL-, .html.

+2

Source: https://habr.com/ru/post/1789871/


All Articles