WordPress WWW Redirect Loop Hostinger: How to Fix It
WordPress www redirect loop on Hostinger? Fix broken URLs, DNS, SSL, Cloudflare and .htaccess redirects with safe recovery steps and SEO checks.

You add www to your WordPress website address, click Save Changes, and suddenly the site stops loading. Your browser might display ERR_TOO_MANY_REDIRECTS, the WordPress dashboard becomes inaccessible, or the new www address refuses to connect.
https://www.example.com, while a server rule, CDN, or redirect plugin keeps sending visitors to https://example.com.The solution is not necessarily to reinstall WordPress, disable SSL, or abandon www. You need to identify which layer is creating the conflict and correct it without introducing another redirect.
This guide explains how to recover a locked WordPress installation through Hostinger hPanel, verify DNS and SSL settings, repair WordPress URLs, inspect redirect rules, and confirm that all versions of your domain resolve to one working address.
📌 Quick Answer: What Should You Fix First?
If your WordPress website broke immediately after adding www, check these settings in order:
- DNS: Confirm that
www.example.compoints to the correct website. - SSL: Confirm HTTPS works for both the root domain and its www hostname.
- WordPress URLs: Ensure the WordPress Address and Site Address use the intended hostname.
- Redirect rules: Look for conflicting rules in Hostinger,
.htaccess, redirect plugins, or your CDN.
Locked out of WordPress? The recovery procedure below uses wp-config.php or phpMyAdmin, so you can repair the website without accessing /wp-admin/.
Why Adding WWW Can Break a WordPress Website on Hostinger
The root domain and its www version are separate hostnames. Although they commonly display the same website, DNS, SSL, WordPress, and your hosting configuration must agree about where requests should go.
Consider a website originally configured as:
https://example.com
Its administrator changes both WordPress URL fields to:
https://www.example.com
That change tells WordPress which public address to use. It does not automatically guarantee that the www DNS record is correct, that SSL is properly configured, or that existing server redirects have been updated.
A redirect loop emerges when two systems issue contradictory instructions. For example, one rule sends the root domain to www while another sends www back to the root domain.
How a WWW Redirect Loop Happens
Conceptual redirect flow — not a live measurement of any website.
Not every broken www address is a redirect loop. A missing DNS record can produce a DNS error, while an invalid certificate can produce an SSL warning. Those failures require different fixes.
Diagnose the WordPress WWW Redirect Loop Before Changing Settings
Your browser’s error message is a useful starting point. Identify what is failing before editing WordPress configuration files or enabling another redirect.
📊 Hostinger WWW Troubleshooting Matrix
Use the visible symptom to choose the most relevant first investigation.
| Symptom | Likely Area | First Check |
|---|---|---|
| ERR_TOO_MANY_REDIRECTS | Contradictory redirects | WordPress URLs, .htaccess, CDN |
| DNS_PROBE_FINISHED_NXDOMAIN | DNS resolution | www CNAME or A record |
| ERR_CERT_COMMON_NAME_INVALID | Certificate hostname mismatch | SSL coverage for www |
| Homepage works, wp-admin fails | Authentication or URL mismatch | Site URLs, cookies, plugins |
| Old website still appears | DNS, browser, or CDN cache | Actual response and DNS target |
These are diagnostic starting points, not guaranteed causes. Multiple configuration problems can exist simultaneously, especially after a website migration or recent SSL change.
Step 1: Back Up Your WordPress Configuration Before Making Changes
When a live website becomes inaccessible, the temptation is to change several settings until something works. That approach makes troubleshooting harder because you can no longer identify which change fixed or worsened the problem.
Sign in to Hostinger hPanel, find the affected website, and open its management dashboard. Interface labels may differ by hosting plan or dashboard version.
Before editing anything:
- Create or verify a recent backup of the website files and database.
- Download copies of
wp-config.phpand.htaccess. - Record the existing WordPress Address and Site Address if available.
- Take note of current CDN, SSL, and redirect settings.
- Change only one configuration layer at a time, testing after each change.
For a production website, restoring its previous working configuration is sometimes safer than forcing a new hostname during an outage.
⚠️ Important: Avoid publishing screenshots of wp-config.php. The file can contain database credentials and WordPress security keys.
Step 2: Check Whether WWW DNS Is Properly Configured on Hostinger
Before WordPress can serve a page at www.example.com, that hostname must resolve to the appropriate hosting service.
Hostinger’s official 🔗 documentation for domains that do not work with www recommends checking the www DNS record.
1. How to Check the WWW DNS Record
- Open the DNS management area for your domain.
- If the domain uses Hostinger nameservers, inspect the DNS Zone in hPanel.
- Find the record whose host or name is
www. - Check whether the record points to the correct root domain or hosting destination.
- If the record is missing, add the configuration recommended for your hosting setup.
For a typical Hostinger-hosted website using the root domain as its DNS target, a www CNAME record can look like this:
Example: WWW DNS Configuration
| Record Type | Host | Target |
|---|---|---|
| CNAME | www |
example.com |
Illustrative configuration. Replace example.com with your domain and follow the requirements of your active DNS and CDN provider.
Do not add a CNAME alongside an existing A or AAAA record for the same www hostname without first resolving the conflict. DNS providers generally do not allow a CNAME to coexist with other data at the same name.
If your nameservers point to Cloudflare or another DNS provider, make changes there rather than assuming Hostinger’s DNS editor controls the active records.
Hostinger notes that DNS changes can take up to 24 hours to propagate. However, waiting for DNS propagation will not repair an actual redirect loop caused by contradictory rules.
2. Check SSL Coverage for WWW
A functioning DNS record is only part of the setup. Both the root hostname and its www variant must serve HTTPS without certificate errors.
Open Hostinger’s SSL settings and check whether certificates are active for the hostnames used by your website. Hostinger includes free SSL certificates with eligible web hosting plans, but a newly configured hostname may still require verification or successful certificate provisioning.
Test both addresses independently:
https://example.comhttps://www.example.com
A certificate warning is not something you should bypass merely to make the website load. Fix the hostname, DNS, or certificate configuration instead.
For the current provisioning requirements, consult 🔗 Hostinger’s Lifetime SSL installation guide.
Step 3: Recover WordPress When You Cannot Access WP-Admin
If the dashboard stopped working immediately after changing the URL fields, you can temporarily set the correct website address through wp-config.php.
This is particularly useful when both the frontend and /wp-admin/ are caught in redirects.
⚙️ Fix the URL Using wp-config.php
- Sign in to Hostinger hPanel.
- Open File Manager for the affected website.
- Find the WordPress installation directory, commonly
public_html. - Download a backup copy of
wp-config.php. - Open the original file in the editor.
- Add the following definitions before the line that tells you to stop editing WordPress.
If you intend to keep www as the primary address, use:
define( 'WP_HOME', 'https://www.example.com' );
define( 'WP_SITEURL', 'https://www.example.com' );
If the www hostname is not configured correctly and you need to restore the previously working non-www website, use:
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
Replace example.com with your real domain. These examples assume WordPress itself is installed at the domain root. If WordPress core files are installed in a subdirectory, WP_SITEURL may legitimately differ from WP_HOME.
Do not add another opening <?php tag to a file that already begins with one. Also check for existing definitions of these constants; do not define them twice.
Save the file, then test your website and admin login using a private browser window.
What does this change accomplish? WordPress reads these constants as URL overrides. They can restore the intended addresses even when the database contains an incorrect value.
However, this is not a universal redirect-loop fix. A contradictory CDN or server rule can still block access.
According to the 🔗 official WordPress configuration documentation, these constants override the saved database options but do not update the database values themselves.
Therefore, if you use the constants temporarily, correct the underlying database values before removing them. Otherwise, the website may revert to the broken configuration.
Step 4: Repair WordPress Home and Site URL Settings in phpMyAdmin
WordPress stores two important URL options in its database:
- siteurl: The location of the WordPress application files.
- home: The public address visitors use to access the website.
For a standard root-level WordPress installation, both values normally use the same scheme and hostname.
To inspect them, open Hostinger’s database management area and launch phpMyAdmin for the database used by your website.
Find the options table. It often appears as wp_options, but its prefix may differ. You can check the correct table prefix in wp-config.php.
Locate the rows named siteurl and home. For a root installation using www, the expected values are:
Expected WordPress URL Values
| Option Name | Option Value |
|---|---|
siteurl |
https://www.example.com |
home |
https://www.example.com |
Edit only the relevant rows after confirming the domain is correct and a database backup exists.
If the wp-config constants remain active, WordPress may continue displaying their overridden values even after you edit the database. Remove temporary overrides only after ensuring the stored URLs are correct and the site remains accessible.
🌐 What About Old Non-WWW Links Inside the Database?
Changing home and siteurl does not automatically update every absolute URL saved in posts, plugin settings, or other database records.
WordPress data can contain PHP-serialized structures. A careless SQL search-and-replace operation can damage those structures.
If a wider URL replacement is genuinely necessary, use a serialization-aware method such as the documented 🔗 WP-CLI search-replace command, with a backup and dry run first. Avoid altering historical post GUIDs during a routine hostname correction.
Not every website needs a database-wide replacement. Confirm whether existing assets and links actually cause problems before changing them.
Step 5: Find Conflicting Redirect Rules in Hostinger
Once DNS, SSL, and WordPress URLs are correct, inspect the redirects themselves.
A website can apply redirects through several independent components:
- Hostinger’s HTTPS enforcement.
- Redirects configured in hPanel.
- Apache-compatible rules in
.htaccess. - WordPress redirect or SEO plugins.
- Cloudflare or Hostinger CDN.
- Custom server or application configuration.
Two redirects are not automatically a loop. For example, HTTP may first redirect to HTTPS and then to www. That is a redirect chain, which can still reach a working destination. A loop occurs when the redirects repeatedly lead back to an earlier URL.
1. Check Hostinger’s Force HTTPS Setting
Hostinger enables HTTPS enforcement by default after SSL installation on applicable Web and Cloud hosting plans.
Open the SSL settings in hPanel and verify the current HTTPS enforcement state. If HTTPS is already enforced there, do not blindly add another HTTP-to-HTTPS rule in .htaccess.
Hostinger documents these controls in its 🔗 HTTPS enablement guide.
Keep HTTPS enabled as your normal final configuration. Temporarily changing enforcement for a controlled diagnostic test is different from leaving a production website on unsecured HTTP.
2. Inspect the .htaccess File
Open .htaccess from the WordPress installation directory. Hostinger’s File Manager typically exposes hidden dotfiles.
Look for redirects mentioning:
HTTP_HOSTHTTPSRedirect 301RewriteRule
If one rule directs visitors from the root domain to www, another must not force the opposite direction.
For an Apache-compatible setup where no other layer already handles the root-to-www redirect, the following example can implement that specific hostname change:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [R=301,L]
Replace the example domain, and insert the rule before WordPress’s managed rewrite block only when your server configuration requires it.
⚠️ Do not copy this rule into every website. If your hPanel, CDN, or another server configuration already performs the same hostname redirect, adding another rule is unnecessary. If you use a reverse proxy, verify its HTTPS configuration before introducing origin-level redirect conditions.
Always retain the original .htaccess so you can revert immediately if the change produces errors.
If you suspect the file itself, you can temporarily rename it for a controlled test. Be aware that doing so may affect permalinks, security settings, or other application rules. Restore or rebuild the necessary configuration afterward.
Step 6: Fix Cloudflare or Hostinger CDN Redirect Conflicts
Some of the most confusing WordPress redirect loops are caused by a CDN configuration rather than the WordPress dashboard.
1. Cloudflare Flexible SSL Can Create an HTTPS Loop
Cloudflare’s Flexible encryption mode accepts HTTPS connections from visitors but contacts the origin server over HTTP.
If the Hostinger origin immediately redirects HTTP requests to HTTPS, Cloudflare can repeatedly make an HTTP request and receive another redirect to HTTPS.
The result is a loop even when both WordPress URL settings appear correct.
Cloudflare explicitly documents this scenario in its 🔗 ERR_TOO_MANY_REDIRECTS troubleshooting guide.
For a correctly configured origin with a valid, trusted HTTPS certificate, Full (strict) is generally the preferred Cloudflare encryption mode.
Before changing the encryption mode:
- Confirm the origin has a valid certificate for the relevant hostname.
- Check Cloudflare’s current SSL/TLS encryption mode.
- Review edge redirect rules, including any www-to-root or root-to-www settings.
- Change the configuration only after determining which layer is responsible.
- Retest the resulting redirect chain.
Do not switch to Flexible to bypass an origin certificate error. Fix the origin certificate instead. Similarly, Full (strict) will not resolve a loop created by an origin that redirects HTTPS back to HTTP.
2. Hostinger CDN Requires Its Own Checks
If you use Hostinger CDN, inspect its status and caching configuration. Hostinger identifies overlapping CDN/proxy services and conflicting manual redirects as possible sources of redirect loops.
Temporarily disabling the CDN can help distinguish a proxy problem from an origin problem, but remember that the test can alter caching and performance behavior.
Review the 🔗 official Hostinger CDN troubleshooting instructions before changing DNS records associated with an enabled CDN.
Step 7: Check Redirects With cURL Instead of Guessing
A browser may display only the final error. HTTP response headers provide more useful evidence because they can reveal each redirect destination.
Open a terminal that has cURL installed and test the four common domain variants:
curl -I http://example.com
curl -I https://example.com
curl -I http://www.example.com
curl -I https://www.example.com
Replace the example hostname with your own.
A response such as 301 Moved Permanently is not necessarily a problem. Examine its Location header to see where the request is going.
To follow the chain automatically, run:
curl -IL --max-redirs 10 http://example.com
The -I option requests response headers, -L follows redirects, and --max-redirs 10 limits the number of followed redirects.
Watch for repeated Location values that alternate between www and non-www, or between HTTP and HTTPS.
Some servers handle HEAD requests differently from normal GET requests. If the results are inconsistent, repeat the investigation with a GET request and inspect the response headers using curl -L -D - -o /dev/null.
🔗 What a Correct WWW Redirect Should Look Like
If www is your chosen canonical hostname, the intended final destination is:
https://www.example.com
Every other public variant should resolve to that URL or its corresponding page path through a finite redirect sequence.
Before vs. After: Redirect Configuration
Illustrative behavior. The corrected example assumes www is the chosen canonical hostname.
The final response for a normal, publicly accessible page should generally be 200 OK. The redirect should also preserve relevant page paths and query parameters rather than sending every request indiscriminately to the homepage.
What if WordPress Still Shows ERR_TOO_MANY_REDIRECTS?
If all four hostname variants have been tested and the configuration appears correct, investigate WordPress plugins and caching components.
1. Disable Redirect and Cache Plugins Temporarily
Start with plugins that can modify redirects, HTTPS behavior, authentication, or caching.
If you have dashboard access, disable one suspected plugin and retest. If the dashboard is inaccessible, Hostinger File Manager can be used to temporarily rename an individual plugin directory within wp-content/plugins/.
Renaming the complete plugins directory can help isolate plugin-level problems, but it may disable critical production functionality. On commerce or membership websites, that approach requires particular care.
Once a plugin-related conflict is identified, correct its settings rather than leaving essential plugins disabled indefinitely.
2. Clear the Relevant Caches
Clear or bypass cached responses after configuration changes, including:
- Browser cache and relevant site cookies.
- WordPress page caching.
- Hostinger server cache, if enabled.
- Cloudflare or Hostinger CDN cache, if applicable.
Cookies can explain a persistent login problem after a hostname change, but clearing cookies will not repair contradictory redirects generated by the server.
Hostinger also provides a detailed 🔗 WordPress redirect troubleshooting guide covering URL settings, plugins, caching, and server configuration.
WWW vs. Non-WWW: Which Is Better for SEO?
One important question often gets overlooked during troubleshooting: do you actually need to switch to www?
For Google Search, neither www nor non-www provides an inherent ranking advantage simply because of the hostname format. Consistent canonical URLs and functioning redirects matter much more than the choice itself.
A website that has operated successfully for years without www does not need to change solely for perceived SEO benefits.
✅ Advantages of Using WWW
- It establishes a distinct www hostname that may fit certain infrastructure and DNS-management strategies.
- It can offer flexibility in some CDN and cookie-domain configurations.
- It may match an established brand’s preferred URL format.
❌ Disadvantages of Switching to WWW
- It requires correctly configured DNS and HTTPS for the new hostname.
- Existing absolute URLs, redirects, and canonical settings may need updating.
- The transition can temporarily disrupt access if different components are not updated consistently.
- It offers no automatic search-ranking improvement over a correctly configured non-www website.
💡 When Keeping Non-WWW Makes More Sense
If your current non-www website is already indexed, stable, and functioning properly, retaining it is usually a reasonable choice unless you have a concrete infrastructure or branding requirement.
At Noxoric, the recommended approach is to establish the intended canonical hostname before editing WordPress or redirect rules, then verify that every participating system points in the same direction.
The objective is not to make the URL look more professional. It is to maintain a predictable, secure, and search-friendly website.
How to Protect SEO After Changing WordPress From Non-WWW to WWW
Fixing the browser error is only the first part of a successful hostname transition. Search engines must also understand which address represents the preferred version of each page.
1. Keep Permanent Redirects Consistent
For an intentional, permanent hostname change, use an appropriate permanent server-side redirect, commonly HTTP 301.
Google identifies permanent redirects as a strong canonicalization signal. Read its official 🔗 redirect guidance for the distinction between permanent and temporary moves.
Preserve each page’s corresponding path. For example:
https://example.com/guide/
Should lead to:
https://www.example.com/guide/
Redirecting every old page to the homepage is not an equivalent replacement and can create search-quality and navigation problems.
2. Check Your Canonical Tags
Open a published page and inspect its HTML source. Its canonical link should reflect the preferred address.
For example, a page using www might expose the following element in the document head:
<link rel="canonical"
href="https://www.example.com/guide/">
This is an illustrative canonical element. Configure it through your SEO system or the website’s document head, not by inserting a duplicate canonical tag into an ordinary article body.
Google recommends consistent canonical signals. Conflicting redirects, canonical tags, and sitemap URLs make the preferred address harder to establish.
See 🔗 Google’s canonical URL documentation.
3. Review XML Sitemaps and Internal Links
Check whether your XML sitemap contains the new canonical hostname. Internal navigation, important article links, and generated metadata should also use the preferred version.
Do not rely exclusively on a sitemap to fix canonicalization. Google considers redirects and canonical annotations stronger signals than sitemap inclusion.
4. Inspect the Website in Google Search Console
Use URL Inspection to test representative pages after the change. Confirm that Google can fetch the intended URL and that indexing is not blocked by an unexpected robots directive.
If the website remains unindexed after the technical problem is corrected, the issue may extend beyond redirects.
For related troubleshooting, see 🔗 Crawled but Not Indexed in WordPress? What to Check First, which covers canonical signals, crawling, and indexing diagnostics.
A working redirect does not guarantee immediate reindexing or unchanged rankings. Google must process the new signals, and other indexing considerations may still apply.
A Safer Sequence for Changing WordPress to WWW
If you have not yet made the change, or you have restored your website and want to try again, use a controlled sequence instead of immediately editing both WordPress URL fields.
📌 Recommended WWW Migration Roadmap
A dependency-based checklist. Each stage should pass its checks before moving to the next.
This order separates infrastructure readiness from WordPress application changes. That distinction is especially valuable when your site is already live and an unsuccessful change would interrupt access for visitors.
When to Contact Hostinger Support
If the redirect loop persists after you have confirmed the correct DNS records, SSL status, WordPress URLs, and CDN configuration, the next step may require server-level investigation.
Provide support with useful diagnostic information rather than only reporting that the website is broken:
- The affected hostname and the exact browser error.
- Whether the problem affects www, non-www, or both.
- The relevant cURL response headers and redirect destinations.
- The approximate time the failure began.
- Recent changes to DNS, SSL, plugins, or redirects.
- Whether disabling the CDN changes the result.
Do not send database passwords, private keys, or other secrets through ordinary support messages.
If you are evaluating Hostinger’s WordPress hosting plans or need to review its current offerings, visit 🔗 Hostinger’s hosting website.
Affiliate disclosure: We may earn a commission if you purchase a hosting service through the Hostinger link above. This does not affect the troubleshooting recommendations in this article.
Conclusion: Fix the Configuration, Not Just the Error Message
When WordPress breaks after adding www on Hostinger, the problem usually involves a disagreement between DNS, HTTPS, WordPress URLs, or redirect configuration. Identifying the responsible layer is more reliable than applying random rewrite rules or repeatedly changing the Site Address.
Start by checking whether www resolves correctly and has valid SSL coverage. If WordPress is inaccessible, use wp-config.php or phpMyAdmin to recover the intended URL settings. Next, audit your hosting and CDN redirects, inspect the HTTP response chain, and verify that every public hostname leads to the same canonical destination.
A stable website should load securely, preserve page paths, allow administrators to sign in, and expose consistent canonical URLs to search engines.
🚀 Explore the Noxoric Web Tools collection for practical utilities supporting website management, development, content creation, and everyday technical tasks.



