⚙️ Advanced Configuration
URL Rewriting with IIS
Configure URL rewriting for SEO-friendly URLs:
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Redirect non-www to www -->
<rule name="Redirect to www" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?!www.)(.*)$" />
</conditions>
<action type="Redirect" url="https://www.{C:0}/{R:0}"
redirectType="Permanent" />
</rule>
<!-- Remove .aspx extension -->
<rule name="RemoveASPX" stopProcessing="true">
<match url="(.*).aspx" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Custom Error Pages
Create custom error pages for better user experience:
- Create custom HTML files (404.html, 500.html)
- Upload to /error_docs directory
- Configure in web.config:
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404" />
<error statusCode="404" path="/error_docs/404.html" responseMode="File" />
<remove statusCode="500" />
<error statusCode="500" path="/error_docs/500.html" responseMode="File" />
</httpErrors>
</system.webServer>
Performance Optimization
Enable Compression
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
</staticContent>
</system.webServer>
Optimize Application Pool
- Set recycling conditions appropriately
- Configure idle timeout (20 minutes default)
- Set maximum worker processes
- Enable 32-bit applications if needed
- Configure rapid-fail protection
MIME Types Configuration
Add custom MIME types for special file extensions:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
<mimeMap fileExtension=".webp" mimeType="image/webp" />
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
Scheduled Tasks (Cron Jobs)
- Go to Tools & Settings → Scheduled Tasks
- Click "Add Task"
- Select task type (Run a command, Fetch URL, Run PHP script)
- Set schedule (minute, hour, day, month, weekday)
- Enter command or script path
- Configure notifications