Loading...

Knowledge Base

Fix CodeIgniter 404 Errors for Internal Links in Plesk

When internal links in your CodeIgniter site return 404 errors. This article explains how rewrite rules affect CodeIgniter on Plesk.
 
This error is observed due to missing or incorrect rewrite rules associated with the application. You can add the below code in the web.config to resolve 404 internal URL errors. 
 
These have to be added in the web.config inside the application installation folder with the help of a developer.
 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rewrite to index.php">
                    <match url="index.php|robots.txt|images|test.php" />
                    <action type="None" />
                </rule>
                <rule name="Rewrite CI Index">
                    <match url=".*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>  

Loading...