• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Cannot use index.php in mod_rewite

Kroptokin

Regular Pleskian
I've just migrated a domain to a new server. From CentOS 6.5 to Centos 7.2

Mostly it has gone pretty well. But in one domain I am unable to use index.php in mod_rewrite.

This is the .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

With this configuration I get the default 'Welcome to Plesk' page. I also see Got error 'Primary script unknown' in the error logs, which may or may not be related.

If I change index.php to (say) home.php everything works as expected.

So. There is some specific configuration issue with index.php.

I tried switching from running PHP as FPM to FastCGI as some threads seem to suggest that as a possible solution but that didn't help.

Does anyone have any ideas?
 
RESOLVED.

Stupid error. index.html was present in the directory. It looks like there must be a DirectoryIndex directive somewhere to serve index.html if it exists.
 
Back
Top