簡體   English   中英

realURL,如果URL中沒有語言(默認語言),則重定向到Frontpage

[英]realURL, if no Language in URL (that is default language) redirect to Frontpage

我有一個typo3網站,使用多種不同的語言,並且我不希望人們訪問默認語言(首頁除外)。

http://example.com/us/home很好
http://example.com/uk/home很好
http://example.com/de/home很好
http://example.com/home不好,應該重定向到http://example.com
http://example.com/home/subpage不好,應重定向到http://example.com

http://example.com/XX/home XX不存在,因此將顯示404頁。 這可以。

我嘗試在noMatch使用noMatchvalueDefault屬性,但沒有成功。

任何想法? 還是我需要為此使用排印?

首先,閱讀如何使用RealURL正確設置語言: https : //github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages您必須完全遵循!

接下來,RealURL不會為您進行重定向。 它僅對URL進行編碼和解碼。 您應該使用Apache設置重定向。 就像是:

RewriteCond %{REQUEST_URI} !^/((de|us|uk)/.*)$
RewriteRule .* /de/%1 [L,R=301]

此代碼未經測試。 嘗試並根據自己的需要進行調整。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM