R
R
Rustam Dranitsyn2021-02-27 15:10:34
MODX
Rustam Dranitsyn, 2021-02-27 15:10:34

How to close a blog from indexing for regional subdomains in modx?

Made a blog for a commercial site with regional subdomains. Regional subdomains are configured using the SEODomains plugin. You need to close the blog from indexing on all subdomains either through robots.txt, or insert the noindex tag for the blog pages of subdomains. There is a solution? Tell me pliz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustam Dranitsyn, 2021-02-28
@rustamdranitsyn

Solved by inserting noindex tag via js. Solution:
if (window.location.hostname.length > "seo-dranitsyn.ru".length) {
let meta = document.createElement('meta');
meta.name="robots";
meta.content="noindex, nofollow";
document.head.appendChild(meta);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question