Last active
September 1, 2022 21:56
-
-
Save ryumada/682a3b65b6539b32264aaceb5ff92c04 to your computer and use it in GitHub Desktop.
web.config for IIS 8 to run codeigniter v3.1.11 application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source: Neeraj Singh answer on https://stackoverflow.com/questions/5408111/codeigniter-2-on-iis-with-web-config-file