Language detection URL domain on localhost

by ThuleNB   Last Updated August 13, 2019 03:07 AM - source

I built a website in German on al local drupal installation. Now, I try to add English as a second language. As language detection method I am using URL. Using the path prefix option everything works well but when I try to use the domain option it doesn't work.

The domain option is what I want to use when the website is finally online.

mywebsite is in German and en.mywebsite is in English.

On my localhost I access my site with localhost/drupal722. I tried to configure the English URL as localhost/en.drupal722 but this does not work.

I deleted the path prefixes of both languages. Regarding the German domain configuration I tried both, leaving blank and insert localhost/drupal722/.

Does somebody has an advice on how to get this working?

Tags : i18n-l10n

Answers 1

It is better that you configue a subdomain or even a complete domain. For example, site1.localhost and site2.localhost and that you change your apache or web server to point to the drupal root folder. Even you can change your OS hosts and link to fake domains, for example, and For multidomain and multilanguage I would recommend these modules which work like a charm: Domain Access and i18n. You can add new sites and in each site have 1 or more different languages. These would solve all your problems as it works very well and it is pretty good in configuring content served from a single installation to several different domains and languages.

January 31, 2015 14:34 PM

Related Questions

Keep node/user tabs in one language

Updated May 16, 2016 08:03 AM

How do I include a custom module translation?

Updated June 28, 2016 08:03 AM

Drupal 8: make Taxonomy terms translatable

Updated August 16, 2016 08:04 AM

How to show 404 page for nodes without translation?

Updated September 01, 2016 08:04 AM

How do I theme the language switcher?

Updated October 11, 2016 09:03 AM