https://prnt.sc/uemncz
My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Code: Select all
User-agent: *
Disallow: /*search=*
and/or set robots tags and headers per individual pages to prevent indexing and following
in catalog/controller/common/header.php
Code: Select all
// index and follow headers
$data['robots'] = false;
if (isset($this->request->get['search']) ||
isset($this->request->get['order']) ||
isset($this->request->get['sort']) ||
isset($this->request->get['limit']) ||
isset($this->request->get['start'])
) {
header("X-Robots-Tag: noindex, follow", true);
$data['robots'] = '<meta name="robots" content="noindex, follow">';
} elseif (isset($this->request->get['route']) &&
(
stristr($this->request->get['route'],'error')
)
) {
header("X-Robots-Tag: noindex, follow", true);
$data['robots'] = '<meta name="robots" content="noindex, follow">';
} elseif (isset($this->request->get['route']) &&
(
stristr($this->request->get['route'],'checkout/') ||
stristr($this->request->get['route'],'account/')
)
) {
header("X-Robots-Tag: noindex, nofollow", true);
$data['robots'] = '<meta name="robots" content="noindex, nofollow">';
} elseif (isset($this->request->get['route']) &&
(
stristr($this->request->get['route'],'FUTURE_PLACEHOLDER')
)
) {
header("X-Robots-Tag: index, nofollow", true);
$data['robots'] = '<meta name="robots" content="index, nofollow">';
} else {
header("X-Robots-Tag: index, follow", true);
$data['robots'] = '<meta name="robots" content="index, follow">';
}
then in catalog/view/theme/default/template/common/header.twig
Code: Select all
{% if robots %}
{{ robots }}
{% endif %}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Hello letxobnavletxobnav wrote: ↑Fri Sep 11, 2020 9:56 amyou can use robots.txt with:
to prevent seacrh engines from even going thereCode: Select all
User-agent: * Disallow: /*search=*
and/or set robots tags and headers per individual pages to prevent indexing and following
in catalog/controller/common/header.php
Code: Select all
// index and follow headers $data['robots'] = false; if (isset($this->request->get['search']) || isset($this->request->get['order']) || isset($this->request->get['sort']) || isset($this->request->get['limit']) || isset($this->request->get['start']) ) { header("X-Robots-Tag: noindex, follow", true); $data['robots'] = '<meta name="robots" content="noindex, follow">'; } elseif (isset($this->request->get['route']) && ( stristr($this->request->get['route'],'error') ) ) { header("X-Robots-Tag: noindex, follow", true); $data['robots'] = '<meta name="robots" content="noindex, follow">'; } elseif (isset($this->request->get['route']) && ( stristr($this->request->get['route'],'checkout/') || stristr($this->request->get['route'],'account/') ) ) { header("X-Robots-Tag: noindex, nofollow", true); $data['robots'] = '<meta name="robots" content="noindex, nofollow">'; } elseif (isset($this->request->get['route']) && ( stristr($this->request->get['route'],'FUTURE_PLACEHOLDER') ) ) { header("X-Robots-Tag: index, nofollow", true); $data['robots'] = '<meta name="robots" content="index, nofollow">'; } else { header("X-Robots-Tag: index, follow", true); $data['robots'] = '<meta name="robots" content="index, follow">'; }
then in catalog/view/theme/default/template/common/header.twig
Code: Select all
{% if robots %} {{ robots }} {% endif %}
This works great!!! but i don't understand what is 'FUTURE_PLACEHOLDER' in the code, can you explain it for me?
Thank you!!!
for example for all information pages you can replace it with information/
or for the contact page you can replace it with information/contact
Attachments
2022-10-20_2.png (21.19 KiB) Viewed 3439 times
HP Web Design
Powering Digital Commerce | http://hpwebdesign.io | http://opencart.id
Opencart Professional Services | Create OpenCart Online Store | OpenCart Tutorials
1. index,follow (index this url and follow the urls on it)
2. index,nofollow (index this url but do not follow any urls on it)
3. noindex,follow (no not index this url but follow the urls on it)
4. noindex,nofollow (do not index this url and do not follow any urls on it)
2 is in there as a dummy to have a url/route which you want indexed except for the urls on it.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Users browsing this forum: psytanium and 32 guests