What code to use fix canonical issue using yoast SEO tool?

souravjns

Newbie
Joined
Dec 30, 2018
Messages
40
Reaction score
2
I want to fix my website's canonical issue using tool section of yoast seo plugins. But I dont know the code. So can anyone will give me the code to provide on .htaccess which will fix my issue?
 
You're going to have to be way more specific here. Rather than just saying 'canonical issue', try explaining what the actual issue is?
 
Check your page/ post yoast Seo tool and update canonical url is settings. It will helps to fix the issue.
You don’t need to do any coding on .htaccess file.

If you wish to improve your website performance check your website in gtmetrix. They will suggest the code to update in .htaccess to improve performance.
 
I just want my site url including web protocol and www. And it should be always like this. It may be called 301 redirection.
 
I just want my site url including web protocol and www. And it should be always like this. It may be called 301 redirection.

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
if you want to make 301 redirect from non-www to www domain add the above code.
 
Back
Top