Forums de discussion

Liferay url rewrite

thumbnail
Jacques Traore, modifié il y a 9 années.

Liferay url rewrite

Junior Member Publications: 49 Date d'inscription: 21/01/13 Publications récentes
Our website (http://172.x.x.x:8080/web/compagny-name/home) has an English and French versions. By default, the En version is applied and a "Fr" link in the website lets you switch to the French one (http://172.x.x.x:8080/fr/web/compagny-name/home). We created 2 domain names: www.mywebsite.com and www.mywebsitefr.com. Both are mapped to the same IP:port(172.x.x.x:8080). The problem is the Fr domain name (www.mywebsitefr.com) brings you to the default version (English) and you have to click on the "Fr" link to reach the French one. I wanted www.mywebsitefr.com brings you directly to http://172.x.x.x:8080/fr/web/compagny-name/home and www.mywebsite.com on http://172.x.x.x:8080/web/compagny-name/home. I have no idea how to do that and what/where should I search for that.
gordon daniels, modifié il y a 9 années.

RE: Liferay url rewrite (Réponse)

Liferay Master Publications: 797 Date d'inscription: 24/08/08 Publications récentes
A proxy in front of the tomcat server will allow virtual hosts that will help make this work. I and many others on the forums use mod_jk for this.

good luck
thumbnail
Jack Bakker, modifié il y a 9 années.

RE: Liferay url rewrite

Liferay Master Publications: 978 Date d'inscription: 03/01/10 Publications récentes
Jacques Traore:
Our website (http://172.x.x.x:8080/web/compagny-name/home) has an English and French versions. By default, the En version is applied and a "Fr" link in the website lets you switch to the French one (http://172.x.x.x:8080/fr/web/compagny-name/home). We created 2 domain names: www.mywebsite.com and www.mywebsitefr.com. Both are mapped to the same IP:port(172.x.x.x:8080). The problem is the Fr domain name (www.mywebsitefr.com) brings you to the default version (English) and you have to click on the "Fr" link to reach the French one. I wanted www.mywebsitefr.com brings you directly to http://172.x.x.x:8080/fr/web/compagny-name/home and www.mywebsite.com on http://172.x.x.x:8080/web/compagny-name/home. I have no idea how to do that and what/where should I search for that.


--
I use apache2 in front of liferay/tomcat and use mod_jk (to connect apache to tomcat listening at port 8009), mod_rewrite (for very profound capability over rewrites), as well as other apache modules like mod_ssl, and then plain old apache redirects

--
Question: I'd be curious to know what approach you are using to 'map' from www.mywebsite.com and www.mywebsitefr.com to *someip*:8080 ... mod_proxy ? or ?

--
in my case I have a sophisticated series of patented gold plated multi-dimensional engine cogs that collectively manifest to create desired whimsical and healthy outcomes emoticon

while such might not fit your use case, if with apache2 in front, you might choose www.mywebsite.com as _the_ virtualhost set in liferay for the liferay site, use mod_jk, and then also create a permanent redirect to point www.mywebsitefr.com to www.mywebsite.com/fr/ including passing along request parameters... if you choose to config your portal to avoid the language prefix, like 'fr', I have a French/English/TraditionalChinese site that also passes in at redirect config an additional parameter like &langid=en_EN which then in code sets the locale on rendering...
thumbnail
Jacques Traore, modifié il y a 9 années.

RE: Liferay url rewrite

Junior Member Publications: 49 Date d'inscription: 21/01/13 Publications récentes
Thanks Gordon and Jack,
I am going to see that way and I will let you know the result.
thumbnail
Jacques Traore, modifié il y a 9 années.

RE: Liferay url rewrite (Réponse)

Junior Member Publications: 49 Date d'inscription: 21/01/13 Publications récentes
Hi there,
Finaly I used the Apache in front of Tomcat approach BUT without mod_jk.
The solution is described here http://stackoverflow.com/questions/24705739/liferay-translation-depending-on-url

Thank you for your contributions
thumbnail
Jack Bakker, modifié il y a 9 années.

RE: Liferay url rewrite

Liferay Master Publications: 978 Date d'inscription: 03/01/10 Publications récentes
mod_jk is not for rewrites, it is a connector

the mod_rewrite approach as described by Olaf at stackoverflow can work, tho request params won't get passed along by that config ; you may not need that tho