B
B
BLM212022-02-26 17:42:10
MODX
BLM21, 2022-02-26 17:42:10

Why is there two slashes at the end of the og:url for the main one?

Greetings, dear connoisseurs.

Site on MODX. Current version: 2.8.3-pl
Only recently I noticed, looking at the source code of the page, that two slashes were added at the end of the main page in the markup. I don't know where to dig to fix this.

Here's the thing in the source code of the page:

<meta property="og:url" content= "https://mysite.com//">


The head chunk looks like this:
<meta property="og:url" content= "http://askmeplz.com/">


Where the two slashes come from is not clear. NOT the main pages of the site in the same og: url at the end without a slash, and after the domain they also do not have two slashes. And here is the source code of the main page with such a problem.

Who could suggest where the dog is buried?

So far, no one has been able to answer, noticed. The url scheme is set to "-1"
If you put any other, it's nonsense. For example, if you put the scheme "1", in the source code
<meta property="og:url" content=https://mysite.com/https://mysite.com/">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Lunegov, 2022-02-27
@BLM21

I answer the question: “where is the dog buried?”
http://askmeplz.com/ returns a string from the system setting with the site_url key, if one is set. If not set, it takes the generated string from the config.inc.php file. You correctly understood that MODX_BASE_URL in your case (and for most sites) adds a slash to the end of the string.
returns a string with the page address formed according to the scheme specified in the system setting with the link_tag_scheme key. You can read more about this setting by following this link . It does not say only one thing that the main page will definitely have a slash. And this is correct, since when forming a link without a domain name for the main page, apart from the slash, nothing else remains.
If you want to keep the option that is in your answer, but also remove the slash at the end of the main page, then you can do this code:

<link rel="canonical" href="http://askmeplz.com/">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question