Hello, we’re sorry to hear that you’re having trouble with the redirection. To redirect the www version of your website to the non-www version, you can add a specific code snippet to your .htaccess
file. Here’s how you can do it:
Steps to Redirect WWW to Non-WWW
-
Edit .htaccess File
You can edit your website’s .htaccess
file directly from the WordPress dashboard. Navigate to:
WordPress Dashboard → Rank Math SEO → General Settings → Edit .htaccess

-
Add the Redirection Rule
After opening the .htaccess
file, add the following code snippet after #END WordPress
:
RewriteEngine On
RewriteCond %{HTTP_HOST} www.example.com
RewriteRule (.*) https://example.com/$1 [R=301,L]
Make sure to replace example.com
with your actual domain name.

-
Save Changes
After adding the code, click on Save Changes to apply the new settings.

Testing the Redirection
You can use an htaccess tester tool to ensure that the rewrites are correct before adding them to your .htaccess
file.
If you continue to experience issues after following these steps, please reply to this ticket with your website URL, and a human agent from our support team will assist you further.
Sources:
How to Redirect WWW Version to Non-WWW Version of Your Website » Rank Math
Why Are Posts Redirecting to www or Non-www Incorrectly?