Browse Source

Add IIS configuration to getting started guide section (#13712) [skip ci]

Supposing configurations for IIS to host Yii2 application. The reference of the code is the following question's answer on Stack Overflow:
http://stackoverflow.com/questions/30470618/iis-and-yii2-pretty-url
tags/2.0.27
Said Bakr 5 years ago committed by Alexander Makarov
parent
commit
0dd5e370df
  1. 27
      docs/guide/start-installation.md

27
docs/guide/start-installation.md

@ -290,3 +290,30 @@ in order to avoid many unnecessary system `stat()` calls.
Also note that when running an HTTPS server, you need to add `fastcgi_param HTTPS on;` so that Yii Also note that when running an HTTPS server, you need to add `fastcgi_param HTTPS on;` so that Yii
can properly detect if a connection is secure. can properly detect if a connection is secure.
### IIS Configuration <span id="iis-configuration"></span>
It's recommended to host the application in a virtual host where document root points to `path/to/app/web` folder. In that `web` folder you have to place a file named `web.config` i.e. `path/to/app/web/web.config`. Content of the file should be the following:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<rewrite>
<rules>
<rule name="Hide Yii Index" stopProcessing="true">
<match url="." ignoreCase="false" />
<conditions>
<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" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
```

Loading…
Cancel
Save