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

    I am having a forward slash issue. Friendly URLS is turned on and set up and running well following instructions found through the forums and internet. I am also managing two URLs from one manager.

    Problems

    1. I have two folders in the root of one domain for two different languages en and es. These folders subsequently contain identical versions and page and container names but the actual content is in respective languages.

    eg
    mysite
    -en
    - subcontainer
    - more stuff here etc
    - subpage.html
    -es
    - subcontainer
    - subpage.html

    When I try to preview the en or es folder from the manager it tries to show me this:

    www.mydomain.comen/ or www.mydomain.comes/ and omits the foward slash between the en and es and the domain name. If I try to preview a sub folder of the es or en containers I get something like www.mydomain.comes/teaching/ which still results (obviously) in an error. Of course I can override this by simply adding the forward slash, but not all my other editors have such common sense or insight.

    2. My containers seem to need a trailing slash in the browser like so for example

    www.mydomain.com/en/teaching/

    if the final trailing slash is not there, the page doesn’t render, but the main problem is that NOR does it forward my user to the 404 page not found, it’s like a "container not found" kind of limbo.

    www.mydomain.com/en/teaching . . . .this (note lack of trailing slash) results in an error.
    Firefox gives me this: Firefox can’t find the server at www.mydomain.comen


    if a user types this kind of error, then they are completely lost. If they type www.domain.com/thiscontainerdoesnotexist then it just forwards them to the 404 file not found page.

    I am hoping there is a real simple answer though I just spent the whole working day looking for a solution.

    Many thanks in advance to my more experience modx peers.
      • 3749
      • 24,544 Posts
      Check out the container_suffix system setting (it should be set to /)and make sure that the container checkbox is checked on the container resources.

      You may need to set a container_suffix context setting.
        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
        • 29380
        • 12 Posts
        Thanks for the response but NO, that is not the solution. I have the container suffix set to "/" and containers’ parameters are checked correctly.

        I think it has something to do with the way it resolves the base url, because when the final forward slash is missing, it contatenates the domain name to the first container thus making the browser think it cannot find the domain. This is why my file not found page isn’t working because the browser cannot find domain www.domainname.comEN/etc

        Maybe others have this issue but don’t realise it because they never have to actually type the domain into the browser.
          • 3749
          • 24,544 Posts
          Do you have this in the <head> section of all templates?

          <base href="[[!++site_url]]" />


          or for Evolution:

          <base href="[(++site_url)]" />


          The site_url system setting normally ends in a slash.
            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
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            Did you make any modification to the htaccess file provided?
              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.
              • 29380
              • 12 Posts
              Mark,

              you hit on the answer (I think) although I had already done it (yesterday) prior to you suggesting it. Just this minute I checked the problem and it’s fixed.

              When I noticed how the actual domain name was rendering I checked the context settings and noticed there wasn’t a trailing forward slash on the site_url, so thinking that it would do no harm either way I added one to see if it had any effect. The problem was that it DIDN’T at that time. But I am guessing that it was most likely a cache issue and since closing the browser and turning off the machine the cache would have finally flushed itself. I think I did do a system cache clear but I can’t remember. If I did, it didn’t have any effect at the time.

              I did also try using other browsers at the time but the problem was still there.

              So indirectly you did actually help me find the solution, so thank you.

              I reiterate that I think this CMS is incredibly cool. I spent ages looking for a decent CMS I was even on the verge of using expression engine (which IS pretty good) when I accidentally came across MODX. I was already in deep with a site with EE but I pulled out and switched. EE still uses a blog starting point and blog references. MODX gives me a great deal of control and treats a website for what it is.

              So thanks again to everyone for all their help. These little solutions mean a lot.
              Carl

                • 36525
                • 47 Posts
                I'm having a similar problem. The site is running fine, but the google sitemap component is not returning a forward slash after the root. Such that it is returning http://www.greengoatmedia.comservices.html in the sitemap.xml where it should be http://www.greengoatmedia.com/services.html. If you browse the site, all forward slashes are in place as they should be.

                It does include the trailing slash for the sub pages like: http://www.greengoatmedia.comblog/designing-a-mobile-responsive-website.html. You can see the slash after blog, but not before blog.

                My container resources are checked as containers. I do have the same base href in my header. And I am running Revolution 2.1.3-pl.

                I recently launched another site with all the same parameters and versions without this problem with the sitemap.xml.

                Any thoughts?
                  Robert Tobys
                  Managing Partner
                  Green Goat Media
                  916.405.1279

                  Skype: roberttobys
                  • 1343 ☆ A M B ☆
                  • 2,213 Posts
                  What's your sitemap call? Did you try clearing the site cache?
                    Patrick | Server Wrangler
                    About Me: Website | Tweets |  MODX Hosting
                    • 36525
                    • 47 Posts
                    Alas, I found a missing forward slash in my core/config.inc.php file. Solved the issue. Thanks anyway!
                      Robert Tobys
                      Managing Partner
                      Green Goat Media
                      916.405.1279

                      Skype: roberttobys