Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Google Sitemaps on 3.1 minor issue? maybe?


Go to End


5 Posts   1216 Views

Avatar
Pix

Community Member, 158 Posts

19 April 2013 at 10:49am

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....

Avatar
Willr

Forum Moderator, 5523 Posts

19 April 2013 at 8:02pm

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.

Avatar
Pix

Community Member, 158 Posts

20 April 2013 at 7:10am

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

Avatar
Willr

Forum Moderator, 5523 Posts

20 April 2013 at 10:46am

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

Avatar
Pix

Community Member, 158 Posts

20 April 2013 at 1:00pm

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.