Problem with sitemaps

  • Hi SPQRInc I've installed the latest sitemap on on this test version of Pagekit. But unfortunately I can’t get it to work. It outputs the following only:


    XML
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <!-- Created with SPQR Sitemap Generator 2.0 https://spqr.wtf --><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4. xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
    5. http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    6. <url>
    7. <loc>http://web.site/</loc>
    8. <changefreq>weekly</changefreq>
    9. <priority>0.5</priority>
    10. </url>


    The backend says okay wait while processing in a notification, I then see a ‘blank’ notification but the above output is all I receive.


    I see there is a debug mode but can’t find the output for this.


    I appreciate you aren’t supporting PageKit anymore due to the lack of development of PageKit itself but would appreciate some help if possible.


    Thanks


    Ade



    EDIT: I'm seeing the following error in inspector:


    Code
    1. Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    2. http://web.site/admin/sitemap/generate
  • Thanks, I enabled both the PageKit debug and the one for SiteMap. Web Inspected shows the same error but with the following errors in console (I don't think they are related):


  • Ok I'm seeing the following error:


  • I just installed/enabled sitemap-generator on a new site, and made some modifications to the extension so that it would use a stylesheet instead of the raw XML. In making the changes I ran across something similar that it was causing mal-formed xml errors, and I ended up diagnosing the cause.


    The following is what I ended up with as the modification made to the /packages/spqr/sitemap/src/Helper/SitemapHelper.php file, and it's working as it should be in my case - with pagekit v1.0.16 on PHP 7.2.8 - to generate a proper map (with a stylesheet I adapted) here: https://for-sale.lumiworx.com/sitemap.xml


    The code I changed is under the public function generate() function, at line 139...




    I'm not sure if this will fix your exact issue, as I was debugging for something different, but if you do try the code above, you can either remove the line to call the stylesheet, or I could post it here to use it if you'd prefer to have one. I intended to add in images support at some point too, but you can leave that section in, since it will only load the reference - that exists - instead of a stylesheet, that doesn't exist (yet).

  • Thanks for the help but in my case it doesn’t seem to have fixed the issues. I can see the newly generated sitemap with your style sheet reference but nothing else.


    Do you be the ‘Sitemap Generated’? I just get an empty notification.

  • Sorry for the late reply. I wasn't getting notifications from the topic....


    Yes, I get everything, as expected. Here's a screen grab with the notifications. The admin backend may be quite different looking, but it's just a heavily modified admin.css. :)


    [Blocked Image: https://testbed.lumiworx.com/u…368b04f67957f8889f37b.png]


    When trying to diagnose my earlier issue, I used FireFox's developer tools to go through all the console and other errors I was getting with the scripts, as well as using 'view page source' on the sitemap.xml file itself to visually see the mal-formed lines. I typed in the URL manually to access it in the browser.


    Is there a sitemap file showing up in your root folder that you can open to read the contents? if the file isn't being generated at all, then it might be a permissions problem with your site's directories, or your host may have restricted something to keep the file from being saved.

  • Thanks for replying. The sitemap IS being generated but doesn’t contain any pages just a bare bones structure. I don’t see any message in the pop up in the backend after the ‘please wait’ popup.

  • I assume that if the file is generated, at least the directory it's generating to doesn't seem to have a permissions issue. The only other thing that stands out is the Vue message (in #3) about the formExclusions "setting a non-existent path".


    Are there any pages added into the excluded page list for sitemap that don't really exist? Are there any pages entered at all - whether they exist or not - that you could temporarily remove and see if it generates correctly with them gone?


    Does the site have a valid SSL cert? If it doesn't, then try to un-check the "Verify SSL" tick-box. If there's no SSL certificate, then that could be interfering with you having valid paths. The generator may have issues if it can't pass any validation tests when there is no such page as, (i.e.): https//mysite.com/blog/hello-world


    You might also try to un-tick the box for "Allow redirects" to see if it generates successfully. If it works, then you might have directives that need to be modified for the site as a whole.


    In my case, I have no excluded pages, the site does use a LetsEncrypt cert that is valid, and I've added a directive into my htaccess file to force all page requests to use SSL, so there is only that one protocol that would ever be valid. There are some other customized directives for redirects in htaccess, but they are security related and don't modify any routes generated by PageKit.


    If none of those suggestions are of any help, I'm not familiar enough with Vue or PageKit routing to help with anything deeper.

  • apt , did you solve your issue? Here, on an 1&1-Server (Ionos), I've got exactly the same issue:


    Click on "GENERATE"
    -> Popup appears "Sitemap-generation is in progress.." After a second, another, empty popup appears.

    -> sitemap.xml file appears in root directory. It just contains xml-info, but no sites are added.


    So, would be great to know if you were able to solve it.