We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37582
    • 65 Posts
    Hey there,

    to distinguish between french speaking Belgians and dutch speaking Belgians I had this in my urls:

    http://mydomain.be/fr/ or http://mydomain.be/nl/

    which would then be translated by my rewrite rules:

    RewriteRule ^(fr|nl)?/?(.*)$ cms/index.php?language=$1&q=$2 [L,QSA]  


    Since my update from 2.2.0 to 2.2.4 this is not working anymore. In my rewrite log I see that there is an internal redirect going on, that was not induced by my rules. I think MODX is doing something. However, I get 310, too many redirects...

    I think this is related to the following issue http://tracker.modx.com/issues/7933. But I don't really know how to fix it.
      • 37582
      • 65 Posts
      The way I see it the system setting friendly_urls_strict is not really helpful for this. I did not enable it, but still my rules are not working anymore.
        • 18373 ☆ A M B ☆
        • 3,141 Posts
        Your title says 2.2.3, your post says 2.2.4, which one is it? tongue (If 2.2.3, definitely upgrade to 2.2.4)

        And when friendly_urls_strict is set to false that should work fine?
          Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

          Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
          • 37582
          • 65 Posts
          Hey Mark,

          sorry for the confusion. I updated to 2.2.4, but I think the changes were made in 2.2.3. friendly_urls_strict is set to false. Does not help.
            • 37582
            • 65 Posts
            Found out that changes made in rev 67c78a0 cause those problems:

            Lines 309 - 311

            +            if ($this->modx->getOption('base_url', null, MODX_BASE_URL) !== $_SERVER['REQUEST_URI']) {	
            +                $this->modx->sendRedirect($this->modx->getOption('site_url', null, MODX_SITE_URL), array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));
            +            }


            In my gateway plugin, I did not change the base_url. Therefore, it tried to redirect for http://mydomain.be/fr/ with request_uri = '/fr/' but base_url was '/' all the time. Fixed it by changing my gateway plugin.

            Thanks for your help!