Answer the question
In order to leave comments, you need to log in
Sharing SPA site?
I have vuejs client and php server. It is necessary to make a beautiful sharing (og: title tags, etc.) of pages.
I read about ssr, it looks very complicated and it's not entirely clear how it works.
In general, I added a check for user_agent and give a page with meta information if the user_agent matches.
function isRobotRequest() {
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
$userAgent = strtolower($userAgent);
if (mb_substr_count($userAgent, 'facebookexternalhit')) {
return 'facebook';
}
if (mb_substr_count($userAgent, 'google')) {
return 'google';
}
if (mb_substr_count($userAgent, 'whatsapp')) {
return 'whatsapp';
}
if (mb_substr_count($userAgent, 'yandex')) {
return 'yandex';
}
if (mb_substr_count($userAgent, 'vkshare')) {
return 'vkontakte';
}
if (mb_substr_count($userAgent, 'telegrambot')) {
return 'telegram';
}
if (mb_substr_count($userAgent, 'twitter')) {
return 'twitter';
}
if (mb_substr_count($userAgent, 'bingbot')) {
return 'bing';
}
if (mb_substr_count($userAgent, 'skypeuripreview')) {
return 'skype';
}
return false;
}
Answer the question
In order to leave comments, you need to log in
Why give these tags only to bots?
There are a lot of software / devices / other services that also support them and display them if available.
This is something at the level of giving seo only to bots, and hiding keywords from people, they are for bots!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question