Hello everybody!
I just migrated my site to Cloudflare Flexible SSL.
If the index sitemap is a secured link, the links contained in that page are just like below.
The number of indexed pages in Google Webmasters dropped dramatically :(
I use Cloudflare plugin with Protocol Rewritting Url enabled.
Yoast Seo is 3.0.7, the latest free version.
Is there anyone who could give a clue? Thx!
http://www.mysite.com/post-sitemap.xml 2016-02-03 18:55
http://www.mysite.com/category-sitemap.xml 2016-02-03 18:55
http://www.mysite.com/post_tag-sitemap.xml 2016-02-03 18:55
The plugin mostly relies on WP API to produce URLs. That is if your WP installation "thinks" that http:// is correct then that is what plugin will output.
You might want to inquire with Cloudflare if there is anything else you should adjust in site's configuration.
Thank you for answering, and sorry for the delay! This is the response from CloudFlare:
Hello,
As they are taking the links directly from Wordpress it will only produce HTTP links as the CloudFlare plugin is not changing this information.
I would suggest using the Full setting as this does not require a valid certificate on the origin but would allow you to change the settings in Wordpress to HTTPS only.
I would suggest doing the following;
Generate a SSL certificate
Install this on your server (This varies greatly so cannot provide a tutorial)
Configure Wordpress to use HTTPS rather than HTTP
Update Crypto settings in CloudFlare to Full
Regards,
I can't afford a SSL certificate on the server, so I installed Arne Brachold plugin for the sitemap, and now I have secured links in sitemap. Maybe you can have a look at his code.
@GermontZ
do you use google xml sitemaps plugin to generate an additional sitemap? i use yoast seo currently and i'm looking for a way to generate an additional sitemap that has https url's in it. apparently this is not possible with yoast.
best,
edit: i figured it out :) for some reason i thought two plugins would try to write to the same file. idk why. it is marvellous that google xml sitemap creates automatically both http and https sitemaps, and apparently have no conflict with yoast whatsoever.
If you're using Cloudflare's Flexible SSL then you can change your Site URLs to be HTTPS, a safe way to do this is adding this code to your wp-config.php
define('SP_REQUEST_URL', ($_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', SP_REQUEST_URL);
define('WP_HOME', SP_REQUEST_URL);
It will use the requested protocol as the site URL, so in Cloudflare you can just create a page rule to send all HTTP traffic to HTTPS, that means the Site and Home URL will always be HTTPS (since you can now use HTTPS).
Your Yoast SEO sitemap will then be in HTTPS. Be sure to turn on the other Cloudflare SSL settings such as automatic rewrites and also use the official Cloudflare plugin
@UVLabs thanks, this worked perfectly.
@UVLabs actually i just realised that the sitemaps are mixed http and https now :( i know this is much to ask but, how can revert this? is reverting to the old wp-config enough?
@gezginorman give it a while for Yoast to regenerate the new URLs, if you made any other change that might conflict with the sitemap in some way I'd say remove them for now.
To revert to the old Yoast Sitemap you can simply remove the code from wp-config
Assuming we have made the redirects to https version. If bots read the URLs of the sitemap and accesses them, it will be redirected to the https versions. So my question is:
Is it really a SEO problem that the urls of the sitemap are without "https"?
http URL redirects to (not submitted) https URL: URL not being https but http lowers score, redirection lowers even further.
Most helpful comment
If you're using Cloudflare's Flexible SSL then you can change your Site URLs to be HTTPS, a safe way to do this is adding this code to your wp-config.php
It will use the requested protocol as the site URL, so in Cloudflare you can just create a page rule to send all HTTP traffic to HTTPS, that means the Site and Home URL will always be HTTPS (since you can now use HTTPS).
Your Yoast SEO sitemap will then be in HTTPS. Be sure to turn on the other Cloudflare SSL settings such as automatic rewrites and also use the official Cloudflare plugin