Run Magento on IIS with URL Rewrite

The purpose of this blog is to run Magento on IIS with URL Rewrite.

Magento is CMS which require rewrite rules for seo friendly url when removing index.php so this is easy when we use magento in linux which have predefined htaccess file so no need to change anything but when we use Windows IIS server then we have to configure web.config file for rewrite rule to take effect.

To run mangento on IIS Window’s server first you need to install the IIS module from Microsoft.

To download IIS URL Rewrite Module  click here.

Now, you can place a web.config file in your Magento root with the following code to get SEO URL’s going on Windows/IIS.

<?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>
</configuration>

To directly download this file click here.

View more posts in this category !!!

Magento Installation Guide Step by Step in Linux.

Balvinder Singh

Hello, I am Balvinder Singh - DevOps Engineer with 2.5+ year of working experience with different server environments. Tag Line:-Linux | AWS| WHM |Monitoring | Virtualization | Optimization | Performance | Security | Release & Deployment. I love helping companies / clients to deploy their code / applicateions to well managed, optimized, secure server and can go extra mile to satisfy.

You may also like...

Leave a Reply

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