We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    I found a tutorial at http://rtfm.modx.com/display/ADDON/getResources.Google+XML+Sitemap and it's not working. Perhaps the last step is where I am stuck. I created the new page "sitemap.xml" in my resources and followed the instructions, but I get a 404 error. How do I get that page to be in my site root? I tried creating a new page in my Files, inserted the suggested code, and that only results in some type of php error.

    Does anyone have any suggestions or a method of how I can create a sitemap.xml? Initially I tried using an online sitemap.xml generater that has worked terrific for my traditional html sites, but with this new MODx site, none of the page links get generated.

    At this juncture, I do not have friendly URLs enabled. Planning to do that a bit later on.

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

    • discuss.answer
      • 32699 ☆ A M B ☆
      • 427 Posts
      Make sure the alias is sitemap.xml

      Switch to the settings tab uncheck everything in the bottom right except emtpy cache. You don't need any of them.

      Set the type to XML

      Set the Template to empty.

      Publish and hide from menu.

      Save.

      Clear cache.

      Hit view


      I assume you installed the Google Sitemap Package from the Repository and have [[GoogleSiteMap?]] as the only page content.
        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
        • 19872
        • 1,078 Posts
        I think I did do all that you mentioned, and the resource is named sitemap.xml. However, it's not in the root of my site so navigating to www.mydomain.com/sitemap.xml should at least bring up a blank page at a minimum. Instead, I get a 404 error.

        I'm in the process of deleting the TVs and chunk I created now. I went to package management and found GoogleSiteMap there, and will give that a try.

        I appreciate your quick response to my query. MODx and this forum is such a great resource. I can only hope that one day, I am more proficient and can offer assistance to others.

        Thank you.
          • 32699 ☆ A M B ☆
          • 427 Posts
          Quote from: mmcgee at Jun 06, 2013, 09:58 PM


          I'm in the process of deleting the TVs and chunk I created now. I went to package management and found GoogleSiteMap there, and will give that a try.

          My instructions are for the GoogleSiteMap Package. Takes about 60 seconds to do once you have done it once.

          Also make sure there is no sitemap.xml file or it will take precedence as MODX will not be feeding that.

          You need a Resource with an alias of sitemap.xml

          the name is non important.
            Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

            Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
            • 19872
            • 1,078 Posts
            OK. I install the GoogleSiteMap.

            Sounds like I need to put this snippet [[!GoogleSiteMap]] somewhere.

            I do not currently have a sitemap.xml file in the root, but I don't understand how to create a resource with an alias of 'sitemap.xml'

            I've created the resource. Set template to 'empty'. Set output to XML. Name the resource 'sitemap.xml' and then I typed 'sitemap.xml' in the Resource alias field. Cleared the cache.
            Also checked the 'Hide Page from Menu' box, and checked the 'Publish' Box.

            But... when I navigate to my domain.com/sitemap.xml I still am getting the 404 page not found.

              • 32699 ☆ A M B ☆
              • 427 Posts
              Is it published? And usually hidden from menus..

              Also, use the view button in the top right.
                Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                • 19872
                • 1,078 Posts
                Hmmm. Just read in the popup menu under resource alias fields "This only works if using Friendly URLs"

                Well... I guess now is a good time for me to turn those on. smiley
                  • 19872
                  • 1,078 Posts
                  When I used the view button in the upper right, a page did appear. Everything was in kind of one long horizontal string — not like the formatting I usually see in an XML file. I'm pretty sure that the friendly URL thing is the issue.

                  Question:
                  Does this snippet only populate the sitemap.xml file with only pages that are published? I guessing it does, but it's certainly worth my asking.

                  I'm anxious about the friendly URLs. The site is new. It's my first, pretty intense site created in MODx. I hope the thing doesn't fly apart like a dollar watch!
                    • 19872
                    • 1,078 Posts
                    When I used the view button in the upper right, a page did appear. Everything was in kind of one long horizontal string — not like the formatting I usually see in an XML file. I'm pretty sure that the friendly URL thing is the issue.

                    Question:
                    Does this snippet only populate the sitemap.xml file with only pages that are published? I guessing it does, but it's certainly worth my asking.

                    I'm anxious about the friendly URLs. The site is new. It's my first, pretty intense site created in MODx. I hope the thing doesn't fly apart like a dollar watch!
                      • 19872
                      • 1,078 Posts
                      Thank you for the assistance. For now, it's late. I'll follow step 1 in Bob's book and back up the ht.access file. Then catch some sleep and attack the Friendly URLs with a fresh brain in the am.

                      Best,

                      Marc