We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13610
    • 52 Posts
    I am not sure what I am missing. I can not get my container to show up in the Friendly URL.

    http://www.mysite.com/container/pagename.html.

    When I go to http://www.mysite.com/pagename.html, it works. When I put in the line above, it doesn't work.

    Both the container and page are published. The container checkbox is checked on the container. The container is set as the parent of the childpage (pagename.html)

    Any thoughts on what I may be doing wrong?

    MODX 2.2.15 on ubuntu (14.04) / AWS-EC2 with MySQL 5.6.23 database in RDS.

    TIA

    Jason

    This question has been answered by jasonabuck. See the first response.

    [ed. note: jasonabuck last edited this post 8 years, 8 months ago.]
      Jason Buck
      • 42562
      • 1,145 Posts
      System Settings [ Friendly URL (17) ]
      Use Friendly Alias Path    --------------    use_alias_path  --------------      No
      Setting this option to 'yes' will display the full path to the Resource if the Resource has an alias. For example, if a Resource with an alias called 'child' is located inside a container Resource with an alias called 'parent', then the full alias path to the Resource will be displayed as '/parent/child.html'.

      Is this what you are looking for? It is in Revolution, don't know if it is in v. 2.2.15
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 13610
        • 52 Posts
        I found the System Setting and changed it.

        No luck!!

        Now when I try to go to the container / page.html I get a 404 error that is the Apache default 404 and not the MODx 404.

        http://aws.tsurl.io/members (works) (members is my container folder)

        http://aws.tsurl.io/members/ (doesn't work) (non-MODx 404 page)

        http://aws.tsurl.io/members/ps-reports.html (doesn't work) (non-MODx 404 page)

        http://aws.tsurl.io/ps-reports.html (doesn't work) (MODx 404 page)

        Here is my .htaccess rewrites (works until you try to navigate down containers).


        # Links to Content with Service Disciplines
        RewriteRule ^documents/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
        RewriteRule ^webinars/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
        RewriteRule ^conference-presentations/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
        
        # Links to Content Directly
        RewriteRule ^documents/(\w+)$ index.php?q=documents.html&DocumentTitle=$1  [L]
        RewriteRule ^webinars/(\w+)$ index.php?q=documents.html&DocumentTitle=$1  [L]
        RewriteRule ^conference-presentations/(\w+)$ index.php?q=documents.html&DocumentTitle=$1 [L]
        
        # Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        
        RewriteRule ^([^/]+)$ /index.php?q=$1 [L,QSA,NC]
        #  RewriteRule ^([^/]+)$ /index.php?q=$1 [L,QSA]


        Please see attached screen shots.

        [ed. note: jasonabuck last edited this post 8 years, 8 months ago.]
          Jason Buck
        • discuss.answer
          • 13610
          • 52 Posts
          This is the MOD_Rewrite that works for me.


          RewriteEngine On
          RewriteBase /
          
          
          # Links to Content with Service Disciplines
          RewriteRule ^documents/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
          RewriteRule ^webinars/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
          RewriteRule ^conference-presentations/(\w+)/(\w+)$ index.php?q=documents.html&DocumentTitle=$2&PageServiceDiscipline=$1 [L]
          
          # Links to Content Directly
          RewriteRule ^documents/(\w+)$ index.php?q=documents.html&DocumentTitle=$1  [L]
          RewriteRule ^webinars/(\w+)$ index.php?q=documents.html&DocumentTitle=$1  [L]
          RewriteRule ^conference-presentations/(\w+)$ index.php?q=documents.html&DocumentTitle=$1 [L]
          
          # The Friendly URLs part
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
          

          The last line RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] was different. If found that in the MODx docs located here (https://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls). Thanks for all help.

          BTW... thanks to donshakespeare - I think it may have been this MOD_Rewrite and System Setting change that fixed the issue.

          Jason.
            Jason Buck
            • 9149
            • 19 Posts
            I'm glad to see someone figured this out, though I'm struggling to understand how to adapt this MOD_Rewrite to my own site structure. What does "PageServiceDiscipline" mean in this (I know it's a value related to your site content, but it isn't clear how)? I'm definitely having the same or a similar problem.

            I'm running the latest version of ModX Revolution, and when I set "Friendly Alias Path" to "YES" (and restart everything), I get 404s on deep links that use the alias path (e.g. mysite.com/biographies/joe-smith.html).

            Michael
              • 3749
              • 24,544 Posts
              Are your links all in the form of link tags? (They should be.)

              <a href="[[~12]]">Some Page</a>
              -- where 12 is the ID of the resource you're linking to.

              Also, make sure you have this tag (with the exclamation point) in the head section of all templates:

              <base href="[[!++site_url]]" />
                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