π ~1 min read
Table of contents
Symptom & Impact
Sites fail with HTTP 500.52 due to invalid inbound rewrite rule processing, often after migration from older IIS hosts. SEO paths, app routing, and API gateways can all break.
Environment & Reproduction
Issue appears after importing web.config or applicationHost.config where rewrite syntax, conditions, or modules differ between hosts.
%windir%/system32/inetsrv/appcmd list modules | findstr Rewrite
Get-Content C:/inetpub/wwwroot/web.config
Get-WinEvent -LogName Application -MaxEvents 30 | Where-Object {$_.Message -match '500.52|Rewrite'}
Root Cause Analysis
Malformed conditions, recursion loops, and module order issues in rewrite sections cause IIS to reject rule execution at request start.
Quick Triage
Validate module availability and quickly isolate whether rewrite rules are the only failing component.
%windir%/system32/inetsrv/appcmd list config '' -section:system.webServer/rewrite/rules
Invoke-WebRequest -Uri 'http://localhost/' -UseBasicParsing
Step-by-Step Diagnosis
Check for duplicate sections, bad regex groups, and unsupported server variables in migrated rules.
%windir%/system32/inetsrv/appcmd list config '' /xml > C:/Temp/iis-site-config.xml
Select-String -Path C:/Temp/iis-site-config.xml -Pattern 'rewrite|rule|condition'
%windir%/system32/inetsrv/appcmd list config -section:system.webServer/rewrite/globalRules

Solution β Primary Fix
Repair or simplify rewrite rules to deterministic tested patterns and recycle app pool/site.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
%windir%/system32/inetsrv/appcmd set config '' -section:system.webServer/rewrite/rules /-"[name='BrokenRule']" /commit:apphost
%windir%/system32/inetsrv/appcmd recycle apppool /apppool.name:''
iisreset /noforce

Solution β Alternative Approaches
Temporarily disable problematic rewrite map and route through ARR/proxy upstream until full rule migration is validated.
%windir%/system32/inetsrv/appcmd set config '' -section:system.webServer/rewrite/rules /enabled:false /commit:apphost
Restart-Service W3SVC
Verification & Acceptance Criteria
No 500.52 responses in logs, expected redirects/rewrites execute, and request latency remains normal.
Get-Content C:/inetpub/logs/LogFiles/W3SVC1/u_ex*.log -Tail 100
Invoke-WebRequest -Uri 'http://localhost/test-path' -UseBasicParsing
Get-WinEvent -LogName Application -MaxEvents 20 | Where-Object {$_.Message -match '500.52'}
Rollback Plan
Restore previous known-good web.config and IIS backup if new rewrite set introduces regressions.
%windir%/system32/inetsrv/appcmd add backup PreRewriteChange
%windir%/system32/inetsrv/appcmd restore backup PreRewriteChange
Prevention & Hardening
Use rule linting, pre-production synthetic tests, and change control snapshots for rewrite-heavy sites.
%windir%/system32/inetsrv/appcmd list backup
Get-FileHash C:/inetpub/wwwroot/web.config
Related Errors & Cross-Refs
Related to 500.50/500.51 rewrite failures, malformed web.config schema errors, and recursion-induced redirect loops.
View all Windows Server 2022 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Microsoft URL Rewrite module documentation, IIS migration checklist, and best practices for web.config transformations.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.