Should I Use Rel="canonical" On My Homepage For Non Www To Www?
I'm really confused about using the
rel="canonical" on my homepage since my website is using www and non www. Should I be using
<link rel="canonical" target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="https://www.example.com/" />
on my homepage since i prefer www, for when someone accesses my domain using a non-www?
You should definitely use canonical url on non-www version to avoid duplicated content problem. And this is true not for homepage but for every page of your website that can be opened with or without www subdomain.
But more preferable way to solve the problem is to configure 302 moved permanentrly redirect instead of rel="canonical". You can do this using your webserver config or .htaccess files.
Read more about how google handles duplicated content in their help article here: https://support.google.com/webmasters/answer/66359?hl=en
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → laravel blade templating error
- → should I choose reactjs+f7 or f7+vue.js?
- → How to dynamically add class to parent div of focused input field?
- → Setting the maxlength of text in an element that is displayed
- → Expanding search bar not expanding before search
- → Get the calling element with vue.js
- → Blade: how to include a section in one page but not in another
- → How to print/log reactjs rendered dom?
- → how to write react component to construct HTML DOM