redirection

#1117583
  • Resolved Nina
    Rank Math free

    Hello,
    How cann I redirect the www version of my website to the version without www? It doesn’t work in the redirection section.

Viewing 1 replies (of 1 total)
  • 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

    1. 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
      Edit .htaccess

    2. 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.
      Add code to .htaccess file

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

    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?

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.