D
D
damarkuzz2019-10-27 18:40:10
htaccess
damarkuzz, 2019-10-27 18:40:10

How to make dynamic text that changes at a certain subdomain value?

How to make dynamic text that changes at a certain subdomain value?
For example, on the spb.site.ru subdomain, the text should change from Moscow to St. Petersburg.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2019-10-27
@damarkuzz

What is the site on? Pure static HTML? If so, then use js to look at the page address in location.href and, based on it, replace the text as needed.

D
damarkuzz, 2019-10-28
@damarkuzz

For those who need a way for JOOMLA.
1) Install the Sourceer plugin from Regular Labs, even the Lite version is enough
2) Insert the HTML insert {source}<?php if (strpos( $_SERVER['HTTP_HOST'], 'krd.site.ru') !== false ){ echo "Krasnodar"; } else { echo "Saint-Petersburg";}
?>{/source}
3) Here are more options How can I compare the text and the response from the server using PHP and display the specified value?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question