掲示板

Liferay url rewrite

thumbnail
9年前 に Jacques Traore によって更新されました。

Liferay url rewrite

Junior Member 投稿: 49 参加年月日: 13/01/21 最新の投稿
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.
9年前 に gordon daniels によって更新されました。

RE: Liferay url rewrite (回答)

Liferay Master 投稿: 797 参加年月日: 08/08/24 最新の投稿
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
9年前 に Jack Bakker によって更新されました。

RE: Liferay url rewrite

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
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
9年前 に Jacques Traore によって更新されました。

RE: Liferay url rewrite

Junior Member 投稿: 49 参加年月日: 13/01/21 最新の投稿
Thanks Gordon and Jack,
I am going to see that way and I will let you know the result.
thumbnail
9年前 に Jacques Traore によって更新されました。

RE: Liferay url rewrite (回答)

Junior Member 投稿: 49 参加年月日: 13/01/21 最新の投稿
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
9年前 に Jack Bakker によって更新されました。

RE: Liferay url rewrite

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
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