We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5994
    • 46 Posts
    Hi guys, I’m having a bit of a problem and I’ll do my best to explain what’s going on.

    I’m in the process of converting my existing website from static html pages to modx with friendly urls, while maintaining all the existing urls as they are.

    In my current static site I have a directory named ’gallery’. In this directory is a page named ’index.html,’ which is an index of, and contains links to, all the other pages in this directory. The urls to these pages look like ’mysite.com/gallery/article1.html,’ ’mysite.com/gallery/article2.html,’ etc. The only reason I needed this darned index.html page in the first place is because the Google bot refused to spider the pages in this directory without it.

    In my site’s current static configuration, I can get to this gallery/index.html page from either ’http://mysite.com/gallery’ or ’http://mysite.com/gallery/index.html’. But there’s no gallery.html

    I’m having some difficulty getting things configured to work like this in modx. Right now I have a container named ’gallery,’ with the alias url set as ’gallery’, and have all the html for the page links in this page’s Resource Content section. But this page’s url is now ’mysite.com/gallery.html.

    If I create a page named index.html inside the gallery directory, I can’t get it to appear in my menu bar, which I assume is because it’s not a container.

    I could do what I’m trying to do by duplicating the content in both the gallery.html page and the gallery/index.html pages, but I was hoping to avoid this route.

    Any assistance on how to handle this problem would be greatly appreciated. This is one of the last stumbling blocks I have on the road to getting my site up and running!

    Cris
      • 3749
      • 24,544 Posts
      If I’m understanding you correctly . . .

      If you check the "Container" checkbox on the gallery document, the URL should show up as yoursite.com/gallery/ (unless you’ve changed the container_suffix system setting).

      Any pages under the gallery container should definitely show up in the menu if they are published and you have the proper Wayfinder tag. Make sure the gallery page is their parent, not a sibling.

      You can create a weblink called "index" as a child of the gallery page with a link to the gallery page in its URL field. It should also show up in the menu.

      When users go to yoursite.com/gallery/index.html, they should end up on the gallery page. (I’m not sure this will work - you might have to do it with a rewrite rule in .htaccess, which might be a better solution anyway.)
        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
        • 36404
        • 307 Posts
        hi,

        bob is right, by far, the best solution is

        RedirectPermanent /gallery/index.html /gallery


        in your htaccess file...
        this way, you avoid duplicate content with our friend google and won’t loose your users smiley

        have swing
          réfléchir avant d'agir