[TYPO3-english] Multi-language rewriting/caching issues

Thomas Skierlo pubtsk1 at pix-pro.eu
Wed Mar 14 23:35:48 CET 2012

Hi Urs,

the condition is the first part of the rewriting rule. It translates to 
"If Url does not start with an (optional) nc, followed by a language 
part (!^(nc/)?(en|de)/?), rewrite it to the default language part 
(http://%{HTTP_HOST}/en%{REQUEST_URI} ). And yes, I'm not using 
.htaccess, so it's vhost.conf syntax. This rule will only work if you 
need your language part in the url, even for the default language - and 
it might look different for htaccess.
It works for me in a multilingual environment with realUrl and tt_news, 
but like I mentioned in my last message, it's probably the wrong way to 
do it.

Kind regards,


Am 14.03.2012 22:46, schrieb Urs Bräm:
> Hi Thomas
> you asked for an improved rule, but I just have another question 
> regarding the same subject...
> I am also looking for a working rewrite rule to avoid Duplicate 
> Content. (cf. 
> http://lists.typo3.org/pipermail/typo3-english/2012-January/078814.html - 
> strange, there are 4 posts in the thread, but pipermail only shows 2)
> I don't mind about it being semantic. But
> > RewriteRule !^(nc/)?(en|de)/? http://%{HTTP_HOST}/en%{REQUEST_URI}
> > [R=301,L]
> isn't working for me, just creates an endless redirect.
> There's a condition missing, could you give me the entire setting?
> Or is that a rule you use in the vhost config? I use .htaccess.
> Thanks a lot
> Urs
> Am 14.03.12 20:50, schrieb Thomas Skierlo:
>> Hello again,
>> the solution from my last message works properly, but it doesn't feel
>> good. It mixes semantic and parameter based rewriting, depends on an
>> active realUrl and certainly will lead into problems some day. A real
>> solution only would check if an L-parameter is part of the querystring
>> and, if not, force one by adding &L=0, the proper value for the default
>> language.
>> So, what I need is a translation of the following semantic rule to a
>> parameter based one:
>> RewriteRule !^(nc/)?(en|de)/? http://%{HTTP_HOST}/en%{REQUEST_URI}
>> [R=301,L]
>> In human words: Check the querystring. If no L-var is set, force L=0, if
>> any L-var is set, leave it untouched.
>> We don't have to take care of the no-cache parameter (nc), since if it
>> is part of the querystring, it still will be after the manipulation. The
>> final rule would get no 301, just an R,L. It would solve the default
>> language problem and would work with or without realUrl, avoiding DC.
>> I went back in this mailing list until 2006, finding 8 occurances of the
>> same topic. All of them came up with a similar solution, having the very
>> same inconsitancies as mine. Maybe a rewriting expert could help to
>> settle this topic forever?
>> Thomas

More information about the TYPO3-english mailing list