Remove index.php in CodeIgniter not working on plesk server

Remove index.php in CodeIgniter not working on plesk server

.htaccess file is used for url related work, such as remove any special character from url and url redirection etc. In Plesk Server .htaccess file does not work because plesk is window server and .htaccess work only with a Linux server. So to resolve this issue we will use the following steps:

Step1: Create a file in root directory named web.config.

Step2: In web.config file write the  following code:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>