Skip to content

IIS "web.config" URL Rewrite Rules for WebEngine CMS

Lautaro Angelico edited this page May 5, 2025 · 1 revision

Even though WebEngine CMS does not officially support Windows IIS web server, we welcome any server administrator or developer to attempt their own integrations.

In this Wiki you will find some configurations that can get you started at running your own instance of WebEngine CMS in Windows IIS Web Server with PHP.


<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Block sensitive folders" stopProcessing="true">
          <match url="^(includes|modules|admincp/inc|admincp/modules)/.*$" />
          <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Access Denied" />
        </rule>
        <rule name="Rewrite 3 segments" stopProcessing="true">
          <match url="^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/([a-zA-Z0-9-_\/]+)/?$" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="^/admincp/$" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php?page={R:1}&amp;subpage={R:2}&amp;request={R:3}" appendQueryString="true" />
        </rule>
        <rule name="Rewrite 2 segments" stopProcessing="true">
          <match url="^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/?$" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="^/admincp/$" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php?page={R:1}&amp;subpage={R:2}" appendQueryString="true" />
        </rule>
        <rule name="Rewrite 1 segment" stopProcessing="true">
          <match url="^([a-zA-Z0-9]+)/?$" />
          <conditions>
            <add input="{REQUEST_URI}" pattern="^/admincp/$" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php?page={R:1}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

  • Finally, make sure you give the user IIS_IUSRS Read/Modify permissions to the files and directories that WebEngine CMS needs to have edit access to.
/includes/cache/
/includes/config/
/includes/logs/

With all this information you should be able to run WebEngine CMS with PHP on IIS.
Since development of WebEngine CMS happens on Linux operating systems, you might encounter issues.

Good Luck!

Clone this wiki locally