掲示板

Disable language based urls?

thumbnail
8年前 に William Gosse によって更新されました。

Disable language based urls?

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
I'm trying stop urls like http://localhost:8080/ja/web/guest/home from working.

I thought limiting the available languages in the portal's display settings would work but it doesn't seem to do the trick.

I also tried locale.prepend.friendly.url.style=0
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Disable language based urls?

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
There's a language filter that handles the locale-based mapping. You should just have to disable that servlet filter to get this outcome.
thumbnail
8年前 に William Gosse によって更新されました。

RE: Disable language based urls?

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
I did try com.liferay.portal.servlet.filters.i18n.I18nFilter=false but the urls still seemed to be available.

I finally blocked these urls by setting up a whitelist of allowable url patterns enforced at the web server level.
thumbnail
8年前 に Christoph Rabel によって更新されました。

RE: Disable language based urls?

Liferay Legend 投稿: 1554 参加年月日: 09/09/24 最新の投稿
Just for reference, I do this:
RewriteCond %{REQUEST_URI} ^/[a-z][a-z]/(.*)$
RewriteCond %{REQUEST_URI} !^/(en|de)/(.*)$
RewriteRule ^/[a-z][a-z]/(.*)$ /$1 [R=301,NC]

If it's not /en/<Whatever> or /de/<Whatever> -> Redirect to /<Whatever>
Hope this helps.
thumbnail
8年前 に William Gosse によって更新されました。

RE: Disable language based urls?

Liferay Master 投稿: 533 参加年月日: 10/07/04 最新の投稿
Thanks.