ewokee
12/4/2017 - 10:30 AM

redirect + https redirect - web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <system.webServer>

 <defaultDocument>
  <files>
    <remove value="index.php" />
    <add value="index.php" />
  </files>
 </defaultDocument>
 <rewrite>
 <rules>
 <rule name="Remove html" stopProcessing="true">
   	<match url="(.*).html$" />
   		<conditions>
     			<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
     			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
   		</conditions>
   	<action type="Redirect" redirectType="Permanent" url="{R:1}" />
 </rule>
 <rule name="Main Rule" stopProcessing="true">
 	<match url=".*"/>
 		<conditions logicalGrouping="MatchAll">
 			<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
 			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
 		</conditions>
 		<action type="Rewrite" url="index.php"/>
 </rule>
 <rule name="wordpress" patternSyntax="Wildcard">
 	<match url="*"/>
 		<conditions>
 			<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
 			<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
 			</conditions>
 		<action type="Rewrite" url="index.php"/>
 </rule>
      <rule name="http to https" stopProcessing="true">
         <match url="(.*)" />
         <conditions>
           <add input="{HTTPS}" pattern="^OFF$" />
         </conditions>
         <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
       </rule>

 </rules>
 </rewrite>
<staticContent>
<clientCache cacheControlMaxAge="7.00:00:00" cacheControlMode="UseMaxAge"/>
</staticContent>
        <httpErrors errorMode="Detailed" />
</system.webServer>
</configuration>