Remove index.php from Magento URL in windows server

To remove the index.php from URL in magento normally we will use htaccess. But, it will work in apache server only. So, to remove the index.php in windows server, we need to use the below code in web.config file.

Save the below code within the “web.config” file and upload it into your magento root directory.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite> 
<rules>
 
 
 
<rule name="Remove index.php Rule" stopProcessing="true"> 
<match url=".*" ignoreCase="false" /> 
<conditions> 
<add input="{URL}" pattern="^/(media|skin|js)/" ignoreCase="false" negate="true" /> 
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
</conditions> 
<action type="Rewrite" url="index.php" /> 
</rule>
 
 
 
</rules>
</rewrite>
</system.webServer>
<system.net>
<mailSettings>
<smtp>
<network host="localhost" />
</smtp>
</mailSettings>
</system.net>
</configuration>

Leave a Reply

Your email address will not be published. Required fields are marked *