On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi there,

    I was assigned the task of moving an old ModX 1.06 instance to a new server. First of all I want to point out that it was a horrible experience so far smiley Putting that aside, I can't figure out this last (I hope) issue, so please help me smiley

    The issue is that some of the friendly urls aren't working and I cannot tell why
    This is the resource structure:
    * My Home
        - BG - container
            > Начало - content
            > За нас - content
            > Проекти - container
                * Project 1 - content
                * Project 2 - content
        - EN - container
            > Home - content
            > About us - content
            > Projects - container
                * Project 1 - content
                * Project 2 - content
        - RU - container
            > Начало - content
            > Для нас - content
            > Проекты - container
                * Project 1 - content
                * Project 2 - content
    


    Aliases are using the resource name, so the alias for the BG container is 'bg', for the content 'Начало' in 'BG' it is - 'за-нас'. The friendly url for it should be http://example.com/bg/за-нас but trying to access it loads the home page. Which seems to be the way ModX handles 404 errors when there is no resource id set to handle them.

    If I try to access http://example.com/en/about-us it loads the content that it should. But it seems that when the alias is written in cyrillic it doesn't work.

    I tried disabling the friendly urls and everything works perfect. Also enabled direct access to the resource so http://example.com/за-нас would work and it does.

    MySQL tables collation is utf8_general_ci
    $database_connection_charset = 'utf8';
    mysqldump on the old server was performed with --default-character-set=utf8
    Import via phpMyAdmin was done with the utf8 connection option enabled.

    .htaccess rewrite rules:
    # For Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    MODX_SITE_URL is http://example.com
    MODX_BASE_URL is / (modx is in the public_html directory)
    MODX_BASE_PATH is /home/example.com/public_html/

    I added <base href="[(site_url)]"> to the header because it was missing, but it didn't change anything.

    Apache/2.2.29, PHP/5.4.39

    curl -I http://example.com/bg/за-нас gives Content-Type: text/html; charset=UTF-8

    So it seems i am out of options that I can think of. Please help smiley

    p.s. I have no previous experience with ModX, so don't rule out the obvious smiley
    [ed. note: nslave last edited this post 5 years, 1 month ago.]
    • I stumbled upon something else that made the whole situation more odd to me. http://example.com/bg/проекти/project-1 works just fine. So now I am thinking that it is an apache/mod_rewrite kind of issue.