Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Google Sitemaps on 3.1 minor issue? maybe?

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 477 Views
  • Pix
    Avatar
    Community Member
    130 Posts

    Google Sitemaps on 3.1 minor issue? maybe? Link to this post

    I'm using SS3.1 and the Google Sitemaps module, but there seems to be a space in the 'loc' url

    <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <script/>
    <sitemap>
    <loc>
    http://testsite.com/rs3/site/ sitemap.xml/sitemap/SiteTree/1
    </loc>
    <lastmod>2013-04-04</lastmod>
    </sitemap>
    </sitemapindex>

    So just before 'sitemap.xml', there is a space. When I try and copy the URL into web browser, it inserts %20 and I wind up with a page not found. When I remove the space, I can get to my sitemap. How to remove the space? Or is that not an issue for Google since it is probably just using a robot? Or is it because I am developing the site in a subdirectory?

    Thanks for any help....

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Google Sitemaps on 3.1 minor issue? maybe? Link to this post

    Do you have a space in your sites BaseHref? https://github.com/silverstripe-labs/silverstripe-googlesitemaps/blob/master/templates/GoogleSitemapController.ss#L4

    Haven't tested the latest 3.1 but the early betas worked fine.

  • Pix
    Avatar
    Community Member
    130 Posts

    Re: Google Sitemaps on 3.1 minor issue? maybe? Link to this post

    Hi Will,

    Thanks for the response. I don't know why, but $BaseHref is indeed returning the URL with a space at the end. If I replace '{$BaseHref}' in GoogleSitemapController.ss with the URL, it works great.

    I don't ever touch the framework so I don't know where I would have changed anything that had to do with BaseHref.

    Anyway, it works now, good enough for me

    Thank you

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Google Sitemaps on 3.1 minor issue? maybe? Link to this post

    You can set your base href from your _config.php file - perhaps double check that for a space.

  • Pix
    Avatar
    Community Member
    130 Posts

    Re: Google Sitemaps on 3.1 minor issue? maybe? Link to this post

    I checked and I did not change it in _config.php. It's such an odd little issue, but at least it is working with a hard coded URL. I'll see if I can get to the bottom of it, I'm just learning about installing with Composer which is way cool so I am going to do yet another installation to see how that works and I will install the sitemaps module to see if I have the same issue. The site in question has some custom pages etc, nothing too fancy, but I am not ruling out that I goofed something up.

    Thanks for your help again.

    477 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.