Search code examples
phpmodx

It is necessary to implement the link so that the English version don't have the prefix /en/


There are 3 versions of the site: Spanish, Ukrainian and English, it is necessary to implement this in such a way that the English version does not have the /en/ prefix It should be something like this: https://example.com/terms/ https://example.com/es/terms/ https://example.com/ua/terms/

<ul class="site-footer__bottom-text-two list-unstyled">
    <li>
        <a href="/[[!*context_key:is=`web`:then=`ua`]][[!*context_key:is=`en`:then=`en`]]  [[!*context_key:is=`ru`:then=`ru`]]/terms/">[[%terms? &namespace=`lang` &language=`[[++cultureKey]]`]]</a>
    </li>
</ul>

I may not have shown all the context that is needed, but I would like to get an understanding of how this can be implemented. Thank you!


Solution

  • It looks like your English context will be used by default, so you need to go into its settings (yourwebsite.com/manager/?a=context) and make sure there is no /en/ prefix in appropriate path settings. Also please check that your context is loaded in the root index.php file, basically there is web context call. Also be careful with next MODX update, it'll rewrite index.php with default value so you should aware there and update file accordingly.