• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue I migrated a domain and .htaccess isn't working

SacAutos

Regular Pleskian
I just completed a migration of a bunch of subscriptions from one server to another running CentOS 8. All of them used .htaccess files. They all are working on the new platform except one. Somehow it stubbornly won't accept under Hosting Settings PHP 7.2 with FastCGI under Apache. I change it and it keeps reverting to FPM under Apache.

I've tried "plesk repair web <domain>" but there's no difference. Any ideas what I can look at to break this deadlock?
 
Could you please clarify the question(s)?

In your headline it says .htaccess isn't working: What exactly is not working? Do you see an "internal server error" message? Is .htaccess present, not causing any errors, but not doing what it is supposed to do?

In the body you are saying that you try to set PHP 7.2 FPM under Apache, but it keeps reverting to PHP 7.2. FastCGI under Apache. That does not seem to be linked to the other issue, and it is a very strange behavior. Are you sure you have read this correctly and it does not say "Nginx"? Could it be possible that you have selected Nginx-only hosting in the Apache & Nginx settings? In that case you can only use PHP with Nginx. That would also explain why .htaccess is not used.
 
We can withdraw this one. I just built a new subscription with a similar but different name. Copied all the content over. Then renamed the original to something different and the new one to the proper name. Now it works. Thanks for listening.
 
i try to configure .html file run as php , but strange thing happen..

I try to add custom values in PLESK "Additional directives for HTTP /HTTPS like:
php_value auto_prepend_file "/var/www/vhosts/mysite.com/httpdocs/open_apache.php"
AddHandler php5-script .php .html .htm
AddType text/html .php .html .htm


THIS dont't work!

in .htaccess its work

php_value auto_prepend_file "/var/www/vhosts/mysite.com/httpdocs/open_htaccess.php"

<FilesMatch "\.html$">
SetHandler php-script
</FilesMatch>


but .php files shown PHP Version 7.4.13 as configured in PLESK ( FRM served by Apache) and .html show PHP Version 5.4.16 !
How can i resolve this problem and configure .html files with correct php version ?
 
i try to configure .html file run as php , but strange thing happen..

I try to add custom values in PLESK "Additional directives for HTTP /HTTPS like:
php_value auto_prepend_file "/var/www/vhosts/mysite.com/httpdocs/open_apache.php"
AddHandler php5-script .php .html .htm
AddType text/html .php .html .htm


THIS dont't work!

in .htaccess its work

php_value auto_prepend_file "/var/www/vhosts/mysite.com/httpdocs/open_htaccess.php"

<FilesMatch "\.html$">
SetHandler php-script
</FilesMatch>


but .php files shown PHP Version 7.4.13 as configured in PLESK ( FRM served by Apache) and .html show PHP Version 5.4.16 !
How can i resolve this problem and configure .html files with correct php version ?
Product version: Plesk Obsidian 18.0.32.2
OS version: CentOS 7.9.2009 x86_64
Build date: 2020/12/21 13:00
also if i try to use composer to install some libs, i get allert about old unsoported version php 5.4.16
 
1) In .htaccess only add this:
AddHandler php-script .html .htm .inc

2) If you are using PHP-FPM: In the PHP icon add this to the additional PHP settings:
[php-fpm-pool-settings]
security.limit_extensions = .php .phar .html .htm .inc

3) If you are using PHP-FPM: in the Additional Apache settings add this:
<IfModule mod_proxy_fcgi.c>
<Files ~ .(?i:inc|html|htm)$>
SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000
</Files>
</IfModule>
(Replace "example.com" with your domain name.)

4) Restart the web server
 
Back
Top