After cleanup or migration, .htaccess may contain partial rules, conflicting redirects, or leftover malicious directives that continue to break the site.
Common symptoms
- The site redirects strangely after cleanup
- Only friendly URLs fail
- A restore brought back unknown rewrite rules
Troubleshooting steps
- Compare the current
.htaccessagainst a clean default from your application or framework. - Remove suspicious rewrite blocks, encoded conditions, and directives you cannot explain.
- Reintroduce only the minimal working rules required for the application.
- Test frontend pages, admin routes, and direct file access after each change.
- Keep a dated backup of the broken file for forensic reference but do not leave it live.
Additional notes
- Malicious redirect logic is often hidden in unexpected conditions or user-agent rules.
- A clean baseline is usually faster than trying to salvage a heavily modified file.
When to contact support
Contact support if a minimal clean ruleset still does not restore normal behavior.