.htaccess file not working on plesk server

.htaccess file not working on plesk server

In this blog, we will learn the solution to the .htaccess file problem on the Plesk server. On the Plesk server when we upload our Codeigniter project our homepage will run perfectly but our inner pages do not work because the .htacess file does not work on the Plesk server and we write index.php remove code in the .htaccess file that’s why our inner pages do not work on Plesk server.

So the solution is that we have to create web.config file on the root directory of our project and paste 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>
 

This code will work fine on the Plesk server and your inner pages will work.