We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29086
    • 6 Posts
    Having worked with both Helicon rewrites and the native rewrite engine developed for IIS7 I must say the URL Rewrite Module is a lot more powerful and versatile, some software it does not seam to work with very well, like magento and even Wordpress to an extent was hard to get to work but worked with some necessary tweeks.
    Modx has been the easiest software package to write a set of rules for to date and we are more than happy to share these with the community so people using IIS7 servers can use the SEO links and all the Modx features with no troubles.
    <rewrite>
                <rules>
                    <rule name="ModX IIS7 Rule 1 (By Simon Fraser)" stopProcessing="true">
                        <match url=".*" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{HTTP_USER_AGENT}" pattern="^.*internal\ dummy\ connection.*$" />
                        </conditions>
                        <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
                    </rule>
                    <rule name="ModX IIS7 Rule 2 (By Simon Fraser)" stopProcessing="true">
                        <match url="^(manager|assets)" ignoreCase="false" />
                        <action type="None" />
                    </rule>
                    <rule name="ModX IIS7 Rule 3 (By Simon Fraser)" stopProcessing="true">
                        <match url="^(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
                        </conditions>
                        <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
                    </rule>
                </rules>
            </rewrite>


    We have these rules currently running on two Modx IIS7 based websites and are having no problems at all and can see no difference from our Apache hosted Modx websites.

    Hope this helps anybody having problems with IIS7 rewrites.
    You only need to make sure your host has the URL Rewrite Module installed on their servers, most good hosts will have this already installed.
    http://www.iis.net/expand/URLRewrite
      • 7045
      • 225 Posts
      I am still getting use to IIS, so forgive the following nobish question. Are you putting those re-write rules in a "web.config" file?

      Thanks in advance
        • 7045
        • 225 Posts
        Thank you sooooooo much for posting your configs. They work great and have saved me so much time. I simply added them to my "web.config" file in my "httpdocs" folder, and I now magically have user friendly URLs in IIS7.
          • 20728
          • 53 Posts
          Thanks for posting this up, it has saved me a job!
            Enovate Design | Web Design Agency Essex
          • Question about MODx in II7 - we’re experiencing some issues with two things: Canonical URLs and the pulgins in the manager not working. Has any experienced that with plugins and also know where to change the canonical URLs? huh
              Sal Baldovinos
              SEO & DIGITAL MARKETING

              ARIEL DIGITAL | Maximize Your Potential
              www.arieldigitalmarketing.com
              • 20728
              • 53 Posts
              I just wanted to share this post as it has provided a solution to a problem I’ve noticed with Revolution when hosted on IIS7.5 on Windows Server 2008 R2:

              http://mtwalsh.tumblr.com/post/1486756180/modx-404-errors-on-iis-7-5

              And this one:

              http://blogs.iis.net/kehand/archive/2009/08/09/php-and-custom-error-pages.aspx

                Enovate Design | Web Design Agency Essex
                • 19388
                • 297 Posts
                And my question is... why this is not in the documentation? :S
                • Please help improve the documentation—obviously some good things here to add!
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 34000
                    • 77 Posts
                    Anybody have any suggestions for adjusting this if Revo 2.1.1 is installed in a folder called revo?
                    If I place the code in a file at the site root (not the revo root folder sub-directory) called web.config.
                    It then prevents me from logging into the manager at all.
                    Making a few adjustments where it looked like maybe they should go and still can’t log in to manager...
                    line 11: <match url="^(revo|manager|assets)" ignoreCase="false" />
                    
                    line 20: <action type="Rewrite" url="http://www_MyDomain_com/revo/index.php?q={R:1}" appendQueryString="true" />
                    


                    Anybody’s help would be golden smiley
                      MODx Revo 2.1 and done!
                      • 36632
                      • 202 Posts
                      I'm new to administrating IIS7.5. Where exactly do I put your rewrite rules?

                      I tried importing them by copying and pasting them into a file named ht.access but the Import function didn't create any rules.