Skip to content

Instantly share code, notes, and snippets.

@ryumada
Last active September 1, 2022 21:56
Show Gist options
  • Save ryumada/682a3b65b6539b32264aaceb5ff92c04 to your computer and use it in GitHub Desktop.
Save ryumada/682a3b65b6539b32264aaceb5ff92c04 to your computer and use it in GitHub Desktop.
web.config for IIS 8 to run codeigniter v3.1.11 application
# htaccess to placed on root folder of php project using apache2 server
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
<!-- web.config for IIS 8 to run codeigniter v3.1.11 application -->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="(.*)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{URL}" redirectType="Found" />
</rule>
<rule name="Imported Rule 1-1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^system.*" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="^application.*" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="/index.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<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?/{R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@ryumada
Copy link
Author

ryumada commented May 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment