Repository navigation
IIS "web.config" URL Rewrite Rules for WebEngine CMS
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.
-
First of all, make sure you install the IIS URL Rewrite module.
https://www.iis.net/downloads/microsoft/url-rewrite -
Get PHP for Windows (make sure to get the non thread safe option)
https://windows.php.net/download/ -
Get the SQLSRV Drivers for PHP (at the moment of writing this wiki there are no drivers for PHP 8.4, so I recommend that you use PHP 8.3)
https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server?view=sql-server-ver16 -
You might have issues with WebEngine CMS paths, for this we recommend that you manually adjust the global paths in these files:
https://github.com/lautaroangelico/WebEngine/blob/master/includes/webengine.php#L37 https://github.com/lautaroangelico/WebEngine/blob/master/install/loader.php#L22 -
Create a
web.configfile in your WebEngine CMS website root directory (this is to rewrite the url's and secure some sensitive folders)
<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}&subpage={R:2}&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}&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_IUSRSRead/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!