I have an PHP based Youtube clone system installed on our server.
The same system is used in couple of countries. Let's say that I have 3 domains that all point to the same system:
www.site.hr
www.site.ba
www.site.rs
They all redirect to some site named www.site.tv
These 3 countries have very similar languages so it makes sense to have the same system for every country, but inside the system it would be great to display banners related to that particular country.
What is the best way to do that, and is it even possible?
My ideas were:
1) to lookup every visitors IP and check from which country is it or
2) to create 3 subdomains hr.site.tv, ba.site.tv and rs.site.tv, which are all
separate systems but share the same database...
I know that first idea is flawed, and second one is plausible. Do you have any better idea?