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

    Fresh install, new website. MODX 1.4.5 - YAMS 1.2.0 RC7

    When I go to the first page http://sub.domain.com/ -> redirect to http://sub.domain.com/fr/home.html -> redirect to http://sub.domain.com/ -> etc. (no ending)

    If I go to an secondary page: http://sub.domain.com/presentation.html -> redirect to http://sub.domain.com/http://sub.domain.com/fr/presentation.html and display the default page (not the presentation.html).

    Yes, http://sub.domain.com twice !!!!

    My .htaccess file
    #Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Exclude /assets and /manager directories and images from rewrite rules
    RewriteRule ^(manager|assets|js|css|images|img)/.*$ - [L]
    RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
    
    # Redirect from mydomain.com/rootname to mydomain.com/rootname/
    RewriteRule ^en$ en/ [R=301,L]
    RewriteRule ^fr$ fr/ [R=301,L]
    RewriteRule ^de$ de/ [R=301,L]
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^fr/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^de/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^en/(.*)$ index.php?q=$1 [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    I don't understand.

    Heeeelp ! [ed. note: neoziox last edited this post 5 years, 8 months ago.]
      • 17301
      • 932 Posts
      Looks like there's a hidden iframe embeeded on the site. Judging from your MODX version it's likely that your site has fell victim to the recent XSS attacks.
      https://modx.com/blog/modx-revolution-2.6.5
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 37909
        • 153 Posts
        I use Evo and not Revo.
          • 3749
          • 24,544 Posts
          Your error_page System Setting is probably set to the home page. If you create a real error page and point the error_page setting at it, it may prevent the infinite loop.

          It won't solve your problem, though, which appears to be that http://sub.domain.com/fr/home.html is not being found and is returning a 404 error (which sends people to the error_page).

          If the fr pages are in a different context, it's not enough just to redirect to them, you have to make sure the fr context is initialized in MODX. YAMS should be doing that, but it looks like it's not happening.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 37909
            • 153 Posts
            @BobRay
            First, when I read your answer, I said to myself: Great! It's brilliant!
            But, I set the [(error_page)] to another page id and… still not working! Infinite loop. sad

            Plus, I'm not sure I understand your third paragraph. Can you tell me more?
              • 3749
              • 24,544 Posts
              I'm not sure my comment is relevant for Evo. If it is:

              I think you're still bouncing because your error page is not being found either (make sure it's published).

              When you make a new request, the index.php file is run. It contains this line:

              $modx->initialize('web');


              That initializes the web context. After that, resources in other contexts basically don't exist and throw a 404 file-not-found error. MODX redirects to your error_page on any 404, so if the request is for a page in a different context, you're always going to your error page. If the error page is not found (again, because it's in a different context), you'll just go around in circles until the server stops you.

              There are various ways around this with mult-language multi-context sites. I'm not sure which one YAMS uses, or even if YAMS uses multiple contexts (or even if Evo *has* multiple contexts). There are several multi-language solutions for MODX Revolution. The migxMultiLang extra seems to be very popular.

              FYI, there is a newer version of YAMS than the one you have (which I believe had a number of problems):

              https://modx.com/extras/package/yams
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 37909
                • 153 Posts
                The version in your link is 1.1.9
                Mine is 1.2

                I don’t found the line inside the index.php file. Are you sure this is for Evo?
                  • 3749
                  • 24,544 Posts
                  As I said, no it's probably not.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 37909
                    • 153 Posts
                    Thanks.
                    So, what’s wrong.
                      • 3749
                      • 24,544 Posts
                      Have you tried installing the current version of YAMS? The RC in the one you have stands for "Release Candidate," so it's close to being a beta version.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting