• Hi all,

    My domain is www.twinmesinhoreca.com

    I’ve tried redirecting the naked domain to www.domain.com, but the problem everytime I tried to redirect to www, the browser keeps getting pop up the site is not redirecting properly . the server redirecting this request for this address in a way that will never complete.

    I’m using redirecting from cpanel when this occur, also tried disabling from cpanel and using .htaccess still found the same problem.
    Is my setting the problem?
    I’ve set the general info in dashboard to www. domain.com, site url to www.domain.com, yoast setting also set to www.domain.com

    In your opinion what’s best practice to redirect it to www? because If accessed from naked domain, it keeps opening new ad tab which is very annoying..

    Thanks for the help,

Viewing 2 replies - 1 through 2 (of 2 total)
  • @tat4,

    It’s hard to diagnose without really looking at your server and WordPress.

    That being said, make sure your Site URL and WordPress URL are set to your www version as desired. Then, use a search and replace tool to ensure all instances in your database are also properly fixed:

    https://www.littlebizzy.com/blog/preferred-domain-redirects

    I don’t recommend using cPanel for this. htaccess should work fine to 301 redirect your naked domain to your www versions:

    #Force www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com [NC]
    RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]

    OR (choose one only)

    #Force non-www:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
    RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
    Thread Starter tat4

    (@tat4)

    @jesse, thank you so much for the explanation:)
    I use the plugin like you describe and change to https:// https://www.domain.com

    should I change the example.com in the script to my domain name ?I tried using cloudflare from my cpanel but it only succeeded to crash my site, thinking of adding the site manually to cloudflare.

    If I use the htaccess script, I can still use cloudflare right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirecting naked domain issues’ is closed to new replies.