-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Country primary - continet secondary #2
Comments
hey, thanks for your feedback 👍 this sounds good as a general rule, do you want to submit a PR for that ? |
I'll try to add it in my fork and will send a PR. |
I came here to suggest the same thing, but i've already implemented it. I think the following code works. It resolves the country first, and then the continent if no country match is found. Country codes are in lower case, continent codes are in upper case, because there are some official continent codes that clash with country codes. Replace the final "if/else" block with this (sorry I don't know how or have the time to do a PR): ` $continentCode=str_replace($countries,$continents,$countryCode); if(!empty($geoLongURL)) { |
Thinking like that it might be even more useful.
Have the country or when there is no country code alternate link it
could look for a continent code as a next step.
Thinking of adding this in a separate fork, didn't do this before here so hope I'm doing it right. :)
For example:
link for Romania redirects to:
link-ro if it exists and stops here.
if link-ro does not exist try to find
link-eu and redirect to that.
if nothing is found, go to link.
This should be possible hopefully, one extra step.
The text was updated successfully, but these errors were encountered: