Saving a page in Cornerstone changes Relative //www. URLs to Absolute http://www. URLs, breaking HTTPS for the page

Hi All,

This is a repeatable problem in which saving a page in Cornerstone changes Relative //www URLs to Absolute http://www URLs, wrecking SSL and forcing database search & replace to fix the page.

  1. Start with a page properly serving images with a RELATIVE PATH: src="//www.domain.com/wp-content/…/ImageName.jpg" (viewed in MSIE)

  2. Add an Alt tag to one image in Cornerstone’s Alt field and save the page (logged into WP site in Chrome)

  3. Every image on that page changes to an ABSOLUTE PATH: src=“http://www.domain.com/wp-content/…/ImageName.jpg”.

  4. Use Better Search Replace and find http:// entries in wp_options and wp_posts

  5. Replace all instances of http:// with //

  6. Reload page in MSIE

  7. Page correctly serves all images with RELATIVE //www. paths (verified in Inspector and at WhyNoPadlock.com)

  8. Return to the page in Cornerstone

  9. Save the page without making any changes

  10. Reload the page in MSIE

  11. Multiple tags have reverted to ABSOLUTE http://www paths (verified in Inspector and at WhyNoPadlock.com)

  12. Repeat steps 4-7

Why does Cornerstone insist on wrecking relative tags with every save, even when nothing changed on the page? Both WordPress Address and Site Address are set to https://domain.com.

Hi there,

Thanks for writing in.

Wordpress works in absolute URL, which is why there is URL configuration under Admin > Settings > General. Configuring Wordpress for SSL/HTTP is not just setting the path to the relative, but making sure all URLs are absolute with HTTPS configuration. It’s Wordpress that manages the URL that is being supplied to the theme and plugins, the theme and plugins are only using the functions provided by Wordpress to get the URL (eg. get_permalink(), wp_get_attachment_url()).

So in order for that to work, you must fully configure your site to https:// instead of just //, then use Better Search Replace plugin to replace all instance of http://www.example.com/wp-content/ by https://www.example.com/wp-content/

Thanks!

Thanks, Rad.

You’re welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.