Canonical URLs for website pages

SYSTEM INFORMATION
OS type and version Ubuntu LTS 20.04
Webmin version 6.17-3
Virtualmin version 1.984
Related packages SUGGESTED

Requirement: Set up canonical URL’s in Virtaulmin, so that search engines only index the www version of any website page.

I am trying to figure out how to use canonical URLs with Virtualmin websites.
The reason is for SEO purposes, so that the search engines recognise https://www.mydomain.com as the authoritive source.

I have tried the normal route using permanent redirect 301 (apache redirects), updating .htaccess etc
However, these both result in a webpage error with too many redirects.
I can add canonical tags, but I would prefer the use of canonical URL’s if possible.
I do have an Apache redirect in place already for http to https:

FcgidMaxRequestLen 1073741824
RedirectMatch ^/(?!.well-known)(.*)$ "https://www.mydomain.com/$1"

In which case you shouldn’t need to alter anything?

Hi again,
Even though the pages resolve correctly, we still need to explicitly set the canonical URLs, otherwise Google, Bing etc. still index the pages as separate items (and list the canonical URL as none.)
I’m looking for a way that we can explicitly set a page as the Canonical URL.

Check serverfault or stackoverflow, the directive is set on the page’s themselves I think.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.