Plesk

WordPress website hosted on Plesk servers shows Error 404 on some pages: File or directory not found

Symptoms

Cause

Rewrite rule is not configured or wrong configured for IIS to handle permalinks correctly.

Resolution

  1. Log in to Plesk GUI

  2. Go to Domains > example.com > File Manager > Click New > Create File , specify File name as web.config
    and click OK to create the file.

  3. Click on
    web.config
     file and paste the following content into the opened Code Editor to configure permalinks via web.config:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="WordPress Rule" stopProcessing="true">
    <match url=".*" />
    <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.php" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

  4. Click OK to save the file.

Additional information

Exit mobile version