How to activate php support in html files?

Hello. Since .htaccess files don’t work, I want to activate it in another way. I found the config files, but I don’t know if I need to make changes to them and I don’t know what to write there.

Wrong. They work fine in Apache+Ngingx Setup.

.html files are HTML files. If you need to use PHP, save the file as .php.

Other than that, your question is totally vague. If you want others to understand, you really need to make good efforts explaining what you need to do.

1 Like

I put .htaccess files instructing php code to be executed in html files, but it doesn’t help. I assumed that the Apache server was not configured to work to handle htacсess files a and thought I needed to tweak nginx.conf for what I needed.
I generated the code with the form designer and it turns out in a file with the .html extension. It also has php code.


and yes, .htaccess definitions are probaly not working due to php-fpm.

1 Like

If it is Nginx + php-fpm

        location ~ [^/]\.index.html(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   index.html;
            include         /etc/nginx/fastcgi_params;
            include     %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;     
1 Like

eris, thank you! Please tell me in which file this code should be carried?

custom template: Web domains and SSL Certicates — Hestia Control Panel documentation

1 Like

Never touch nginx.conf files or default templates.

Always use your custom templates.

1 Like

I’m sorry, but I don’t understand where I can find my custom templates.

You can find it here in this link.

Could you provide a link to the relevant article, because I do not understand English well (I use a computer translator and understand a little myself) and it is difficult for me to find the necessary information on my own.

It’s all here, there is nothing more to add - we can’t provide a step by step tutorial (basicly it is already).

1 Like

Can you please tell me if it is possible to create or configure htaccess files to work? I may not be against Apache in conjunction with Nginx. But I don’t know how to do it.

I might have misunderstood, but are you talking about setting php variables like max_post_size?

If so, you can set those in .user.ini instead of .htaccess, in the same directory.

<FilesMatch \.php$>
    SetHandler "proxy:%backend_lsnr%|fcgi://localhost"

Should work where 90xx

Sorry, but I misunderstood your question, I think not.

Thanks to. Please tell me how this code is decrypted, that is, what exactly does it do? In which file should this code be placed?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.