Code

Opened 5 years ago

Closed 2 years ago

#11485 closed Bug (duplicate)

sitemap.xml doesn't support https urls

Reported by: sportsboy Owned by: nobody
Component: HTTP handling Version: 1.0
Severity: Normal Keywords: sitemap, https, ssl
Cc: mmitar@… Triage Stage: Accepted
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

it's not possible to display the urls in the sitemap.xml with https.

monkeypatch:
(if you use https only)
just replace the "http" with "https" in the django\contrib\sitemaps\init.py

Django version 1.0.2 final

Attachments (0)

Change History (9)

comment:1 Changed 5 years ago by adamnelson

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

To clarify, I believe your problem is that you can't specify the protocol in the <loc> section of the sitemap.xml file:

http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/#django.contrib.sitemaps.Sitemap.location

I believe the bigger issue here is that the get_absolute_url can't be told which protocol to send back:

http://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url

Can you update the ticket if this is what is meant?

comment:2 Changed 5 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by mitar

  • Cc mmitar@… added

+1

This is really a problem as for HTTPS only sites which use redirects to redirect users to HTTPS version Google Webmaster Tools show this warning:

When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL.

comment:4 Changed 4 years ago by mlavin

This is one of the enhancements contained in the patch on #8995. It might be best to break up their patch into smaller enhancements to get this issue closed. Or we could close this as a duplicate.

comment:5 Changed 3 years ago by julien

  • Severity set to Normal
  • Type set to Bug

comment:6 Changed 3 years ago by anonymous

  • Easy pickings unset

+1

I am also experiencing problems in Google Webmaster Tools because of this issue.

comment:7 Changed 3 years ago by madisv

  • Needs documentation set
  • UI/UX unset

+1

This is really a problem for SSL secured sites who want to use the framework.
As this problem with secure and unsecure URLS has had an impact on my projects also before - I would really want a setting for this to be added.

Another option is to modify the Sites framework to figure this out from the requests.

Another note is that the docs are wrong - sitemap framework does not need sites framework anymore. I made a pull request for this.

comment:8 Changed 3 years ago by jezdez

Please stop +1'ing the ticket, Trac isn't Google Plus. The ticket has been accepted and a +1 won't help fixing it quicker.

comment:9 Changed 2 years ago by claudep

  • Resolution set to duplicate
  • Status changed from new to closed

I think this has been resolved when fixing #8995.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.