Jump to content

Module: XML Sitemap


Pete

Recommended Posts

  • 4 weeks later...

Hi!

I installed version 1.1.0.

My site contains 12 pages. In the mydomain.com/sitmap.xml is just the startpage.

Are there some modulesettins i have to change in order to get a correct sitemap?

Thanks an regards!

PS. I also tried the Ryans template solution for the sitemap. It also outputs just the startpage in the xml-sitemap.

Whats my mistake?

PPS. SORRY my mistake! A few parent sites were set to "hidden". After i set them to "visible" the xml-sitemap is fine!

Link to comment
Share on other sites

  • 3 weeks later...

I have installed this module however, I have some pages that are hidden from the navigation, in which I still want them added to the sitemap. I have added a checkbox field called sitemap.  This field allows the user to add to the /sitemap page.

Here is what I use for the sitemap template:

foreach($page->children("include=hidden, sitemap=1") as $child) sitemapListPage($child); 

I need to do the same thing but for the sitemap module. I am having some trouble accomplishing this. Any help would be great.

  • Like 1
Link to comment
Share on other sites

@Macrura - Good point, already solved my problem! Thanks for the advice. I ended up just building my own template and following ryans advice.  Was able to create an array that pin points the hidden pages I want included in the sitemap. 

Link to comment
Share on other sites

  • 6 months later...

I'm getting a 404 response when I hit mydomain.com/sitemap.xml. The sitemap data is there, and there are no errors. I understand that the module works by hooking into the 404 page, but I also see in the module code that the header is explicitly being reset to 200. This is an issue because Google Webmaster Tools won't accept the sitemap due to the 404 header. Any suggestions on how to debug this? I assume no one else is having this issue, so it's probably something unique with my setup, rather than an issue with the module itself, though I am not doing anything in my code to override the HTTP response code, to the best of my knowledge.

Link to comment
Share on other sites

@Jason,

To my understanding, you cannot see the xml file when you try to access the /sitemap.xml page ?

If so, be sure the xml template settings in Processwire has no checked for, should page URLs end with a slash.

That should get rid of the 404 and Google will pick up the xml, I have built multiple sites with this setup and all work well.

Link to comment
Share on other sites

  • 3 weeks later...
I'm currently getting a 404 when i try to access domain.tld/sitemap.xml

Actually, that URL results in the address refreshing to http://sitemap.xml/

My 404 page template (which I believe this sitemap uses) has no trailing slash enabled so I don't think it's the same issue.

Google WMT is telling me too that there's an issue with the sitemap.

Any pointers on where to look?
Link to comment
Share on other sites

Did you add a new template specifically for the xml template?

I seem to have a page called sitemap but the template it's based on is a generic basic page and not specifically a sitemap version.

I can't recall where that page came from or why it was created as my understanding of this template is that you simply install it and it'll create the /sitemap.xml

Just looked at my other sites with working sitemaps. None of them have dedicated sitemap templates or even pages with the admin or require those to work.

Based on that, I'm a bit baffled. 

Link to comment
Share on other sites

  • 6 months later...
3 hours ago, Lance O. said:

Is there a way to force "www" on the links generated in the sitemap.xml file?

Your web server should be configured to have a single canonical domain to avoid fragmentation of SEO and analytics, and your sitemap should use it. If the "www" version of the domain is canonical, requests for sitemap.xml will be redirected to that domain and the generated links should match. The module simply uses the value of $page->httpUrl. ProcessWire's .htaccess file includes directives for Apache to set a canonical domain, but they are commented out by default. Look around line 123:

  # -----------------------------------------------------------------------------------------------
  # 13. OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable).
  # For example: http://processwire.com/ would be redirected to http://www.processwire.com/
  # -----------------------------------------------------------------------------------------------

  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

  • Like 3
Link to comment
Share on other sites

I should have mentioned that I already have those two lines commented out before I posted my question. But now that I check the sitemap.xml file again, the "www" has been added to the urls. Looks like it may have just been a caching issue. Thanks for your insight!

Link to comment
Share on other sites

  • 4 months later...
On 19-3-2014 at 10:22 AM, kixe said:

Update 29.02.16
This update is made for PW 3.0. To prevent endless redirects in 2.7 and lower please read instructions (comments). You need to comment out the line with the redirect.
multilang-sitemap-xml.php.zip

@kixe It doesn't seem to work for me on PW 3.0.47

This is the error I get:

Error: Uncaught Error: Call to undefined function wire() in […]/www/site/templates/multilang-sitemap-xml.php:116

Link to comment
Share on other sites

  • 5 months later...

Hi Pete

I have XML sitemap installed and it's listing my URLs as http://domain.com without the www

The site is set (with .htaccess) to display with the www and this is working. IE any requests for http://domain.com deliver http://www.domain.com. So I'm not sure why it's picking this non www up or where it's coming from.

Additionally, I've disabled ProCache, reinstalled the XML Sitemap Module checked that the source of the actual pages META tags are correct IE

<link rel="canonical" href="http://www.domain.com" />

Any pointers appreciated. 

Pete - think this was a caching issue. All fixed now.

 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...