PHPackages                             in2code/ipandlanguageredirect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. in2code/ipandlanguageredirect

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

in2code/ipandlanguageredirect
=============================

Redirects TYPO3 visitors automatic or with a suggestlink to another language and/or root page.

13.0.0(9mo ago)1738.0k↓11.4%16[2 issues](https://github.com/in2code-de/ipandlanguageredirect/issues)[1 PRs](https://github.com/in2code-de/ipandlanguageredirect/pulls)GPL-2.0-or-laterPHP

Since Nov 1Pushed 4mo ago6 watchersCompare

[ Source](https://github.com/in2code-de/ipandlanguageredirect)[ Packagist](https://packagist.org/packages/in2code/ipandlanguageredirect)[ Docs](https://github.com/einpraegsam/ipandlanguageredirect)[ RSS](/packages/in2code-ipandlanguageredirect/feed)WikiDiscussions typo3\_13 Synced 1mo ago

READMEChangelog (1)Dependencies (31)Versions (38)Used By (0)Security (1)

TYPO3 Extension ipandlanguageredirect
=====================================

[](#typo3-extension-ipandlanguageredirect)

TYPO3 FE visitor automatic or manual redirect to another language or another root page.

Introduction
------------

[](#introduction)

This extension allows **multi-language** and **multi-domain** handling with redirects to best fitting pages with best fitting language based on the visitors browser language and region (IP-Address).

An AJAX-request (VanillaJS only - no JavaScript framework is needed) will handle the serverside-domain-logic to redirect or suggest a new webpage or a new language.

Define in your PHP-configuration which countries belongs to which pagetree and which browserlanguage belongs to which frontend language

### In short words

[](#in-short-words)

Automaticly **redirect** or **show a note** for the visitor to give him the best fitting website version for his/her needs.

### Screens

[](#screens)

Example suggest message in frontend: [![Suggest a language](Documentation/Images/screenshot-frontend-suggest.png "Suggest a language")](Documentation/Images/screenshot-frontend-suggest.png)

### Which way is used to get the country code of the user?

[](#which-way-is-used-to-get-the-country-code-of-the-user)

This is completely your choice now. You can choose between different ip2country service classes. There is a local table with ip-ranges and countries on the one hand and on the other hand, you can also use external services to convert the visitors ip to a countryCode. While the first methods respects all privacy the second method is more current of course.

Or: You can combine different methods: Because the service of IpApi is for free for 1000 requests a month, you can use this and in addition the offline-table variant.

Available classes per default:

- `In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\IpApi` - This uses the external service of ipapi.co to convert IP-addresses to a country code. Note: You can set the api key via TypoScript if you want to use more then 1000 requests a month
- `In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\LocalDatabase` - This uses the local database table `tx_ipandlanguageredirect_domain_model_iptocountry` to convert the ip address to a country - no external service, most privacy
- `In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\IpApiCom` - This uses the external service of ip-api.com to convert IP-addresses to a country code. Attention: Because https is not possible by this service all request are handled over port 80

Go to the extension manager settings and choose the classes that you want to use or simply add your own service. Example string in the extension manager settings for `ipToCountryService` could be `In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\IpApi,In2code\Ipandlanguageredirect\Domain\Service\IpToCountry\LocalDatabase`to use the service of IpApi as long as it is free and then fall back to the local database.

### What's the difference to other extensions like rmpl\_language\_detect?

[](#whats-the-difference-to-other-extensions-like-rmpl_language_detect)

There is a basic difference in the concept. While most of the language-redirect extensions hook into the page rendering process via USER\_INT, we choose an ansynchronical way with JavaScript and PHP (AJAX). This solution needs JavaScript on the one hand but is much faster for high availability and more complex websites on the other hand. This means: You can use e.g. [staticfilecache](https://github.com/lochmueller/staticfilecache) or another static solution to improve web performance. While it's not possible to use staticfilecache with a USER\_INT, which is included on every single page.

### Testing!

[](#testing)

This extension allows you to test how your website will react if a visitor from a different country checks out your website. See below for a lot of testings possibilities.

Installation
------------

[](#installation)

- Install this extension
- Add a static template (page.5 will be used for the suggest container, page.1555 for the script)
- Copy the original configuration from ipandlanguageredirect/Configuration/Redirect/Redirect.php to any other location
- Modify the configuration for your needs
- Set the new path in the extension manager to your configuration file
- Have fun!

Example configuration
---------------------

[](#example-configuration)

```
