An Apache redirect can move WordPress traffic from HTTP to HTTPS in one hop. A copied rule can also create a loop behind a CDN, trigger a server error in the wrong directory, or disappear when WordPress rewrites its generated block.
Confirm the server and proxy topology, back up the active file, and add only the rewrite rule required for the verified request path.
What it means
.htaccessis an Apache directory-level configuration file. An HTTPS rule checks an insecure client request and redirects it to the same resource on the canonical secure URL.
Nginx does not read this file. Behind a proxy, the origin scheme may differ from the visitor scheme, so the condition must use trustworthy information from the known proxy.
A realistic WordPress example
A site already redirects at its CDN, but an administrator adds another HTTPS rule at the origin. Because the proxy contacts Apache over HTTP, the new rule redirects every origin request and the edge repeats it indefinitely.
Removing the duplicate origin rule and keeping the CDN as the single redirect owner restores the direct path.
Why it matters and when to use it
A correct redirect protects old links and typed HTTP addresses without changing their resource path. A poor rule can block login, APIs, callbacks, static files, and every public request.
Use .htaccessonly when Apache reads the active file and the server layer is the chosen owner of the HTTP-to-HTTPS redirect.
A straightforward route for beginners
- Verify that HTTPS works directly before adding a redirect.
- Confirm that the site uses Apache and locate the active document root.
- Save a copy of the current
.htaccessfile and keep file access open. - Identify existing CDN, server, plugin, and WordPress redirects.
- Add the narrow rule outside the WordPress-generated markers.
- Test HTTP and HTTPS for the home page, a deep path, and a URL with a query string.
The advanced route
Trace responses without following redirects and inspect each status and Locationheader. Verify proxy scheme detection, host allowlisting, directory inheritance, and how the rule handles methods used by APIs or callbacks.
Test the edge and authorized origin, login, REST, media, missing pages, static files, and callback URLs. Keep hostname canonicalization separate unless it is part of the same reviewed rule.
Risks, common mistakes, backup, and rollback
A rule added before certificate readiness, a spoofable forwarded header, or an edit in the wrong directory can cause loops, open redirects, or HTTP 500 errors. Code inside WordPress markers may be overwritten on a permalink save.
Rollback means restoring the known-good saved file through independent server or hosting access. Do not enable HSTS while diagnosing the redirect, because a cached browser policy can obscure whether the server rollback worked.
How AIOWS helps:
AIOWS SSL Manager
AIOWS SSL Manager can help review supported WordPress-side HTTPS settings after the server redirect is working. It is useful for confirming that WordPress uses the canonical HTTPS address and behaves correctly behind the chosen redirect layer.
AIOWS cannot make Apache read the correct file, change CDN rules, authenticate proxy headers, or recover a syntax error that blocks the site. Those controls require server access.
After adding the rule, use SSL Manager to check WordPress URLs, login, assets, forms, and callbacks. Pair that with raw response traces so every HTTP resource reaches canonical HTTPS directly and HTTPS requests are not redirected again.
Related AIOWS articles
- Fix Mixed Content in WordPress: HTTPS Error Guide
- How to Enable HSTS in WordPress Safely
- WWW vs Non-WWW HTTPS Redirects in WordPress
Conclusion and recommended route
Use .htaccessonly on a verified Apache path with working TLS, one redirect owner, correct proxy trust, and independent file access. Preserve the requested resource and reach canonical HTTPS in a single predictable hop.









