I
I
Ilya Beloborodov2017-08-18 18:34:13
Search Engine Optimization
Ilya Beloborodov, 2017-08-18 18:34:13

One product page for two cities or more?

There are two, almost identical pages.
For example https://example.com/dress/some-name/odessa and https://example.com/dress/some-name/kiev
The difference is only in the title and description, depending on the page either "buy in Odessa" is substituted or "buy in Kiev".
Actually the question is: is it possible to trade like this, maybe there is some kind of meta tag for such cases?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Goryachev, 2017-08-18
@webirus

<?php
$domains = array(
'sitename1.ru'=>'в Рязани и Рязанской области', // выводится на первом домене
'sitename2.ru'=>'в Москве и Московской области', // выводится на втором домене
'default' => 'в вашем городе и области', // выводится там, где домен по какой-то причине не определен, чаще всего на локалке при разработке
);
$site = strtolower($_SERVER['HTTP_HOST']);
$site = str_replace('/^www\./', '', $site);
if (!array_key_exists($site, $domains)) {
$site = 'default';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question