Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I've been on the road for a bit now - my apologies for a very delayed response!! i really appreciate your input on this. i can't quite digest all of this good stuff right now - will update once i've been able to process.
On the 301 redirection - here is what I've added within the htaccess file: RewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]# and added this to then get from non-www to wwwRewriteCond %{HTTP_HOST} ^example.com [nc]RewriteRule ^(.*)$ https://www.example.com/$1 [r=301,nc] Based on what you've outlined above, it looks as though my solution is (a) not necessarily correct if not canonical in the first place, and (b). also not correctly written up. I don't quite understand what the L is for in place of the NC?
On the question of whether my canonical hostname uses the www subdomain - i don't know, to be honest? Can i check this (and, is there a location where i should check it?) Is this something to inspect on the webhost system, or within the actual site content?
Really appreciate the feedback! i've added in my individual responses just below this. Regarding referencing URL using either the root domain or the www. prefix, i'm using root relative linking? So for example, to get to my profile page the link is href="/profile.html" from anywhere in the website, so that it finds the root. i'll admit that i still do not understand the implications around the search engine optimisation for this - would this then mean that this could be interfered with when it comes to search engines identify the canonical pages?
This is correct, and i (kind of) understand now. Unfortunately, i misinterpreted the original concept as still requiring including the document relative file paths. As a result, yes, the links do still function, but i am guessing - i still do not know or quite understand how - that these may be causing at least some of the hundreds of 404s we are still seeing. Some appear to be old legacy links from the previous website. I have 301 redirected these and am currently removing the '../' indicators from everywhere in the website, including navigations, image links, and document links.
Many thanks for this feedback! I have gone through every HTML instance on the website and modified the href=" values for these, to include a leading slash. I would imagine the next step is to process a new sitemap.