Title: HTTPS rewriting appears to break AMP pages
Last modified: September 1, 2016

---

# HTTPS rewriting appears to break AMP pages

 *  [vitamincee](https://wordpress.org/support/users/vitamincee/)
 * (@vitamincee)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/)
 * I get the following error in my Webmaster Tools dashboard for every page on my
   site:
 * “The mandatory tag ‘amphtml engine v0.js script’ is missing or incorrect.”
 * It appears that if I turn off HTTPS rewriting in the cloudflare plugin it resolves
   it, but then my https pages break layout.
 * Any idea why this function would break the amp scripts? I’m using the automattic
   amp plugin.
 * Thanks!
 * [https://wordpress.org/plugins/cloudflare/](https://wordpress.org/plugins/cloudflare/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [jwineman](https://wordpress.org/support/users/jwineman/)
 * (@jwineman)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7689053)
 * Hi,
 * Can you post the script include for the automatic amp plugin that is being rewritten
   incorrectly?
 * Thanks,
    John
 *  Thread Starter [vitamincee](https://wordpress.org/support/users/vitamincee/)
 * (@vitamincee)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7689143)
 * hi, the source code shows this:
 * <script src=”//cdn.ampproject.org/v0.js” async></script>
 * i believe that script needs to be loaded over https, and it’s not.
 * a few other people seem to be having this same problem:
 * [https://wordpress.org/support/topic/amp-validation-had-errors](https://wordpress.org/support/topic/amp-validation-had-errors)
 *  [jwineman](https://wordpress.org/support/users/jwineman/)
 * (@jwineman)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7689144)
 * Hi,
 * // without http or https will force the link to load over whatever protocol is
   used to load the webpage its included on. So if the script needs to load over
   https you need to load your blog over https as well.
 * Thanks,
    John
 *  Thread Starter [vitamincee](https://wordpress.org/support/users/vitamincee/)
 * (@vitamincee)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7689145)
 * The script is loading over HTTPS when the “HTTPS Protocol Rewriting” is turned
   OFF on the Cloudflare plugin.
 * I turned it to off, and reloaded the page, and this is what I see now:
 * <script src=”[https://cdn.ampproject.org/v0.js&#8221](https://cdn.ampproject.org/v0.js&#8221);
   async></script>
 * however, turning that rewrite off screws up my https pages layout.
 * Any idea how I can get the “HTTPS Protocol Rewriting” to not strip that https
   of a script if loaded over http?
 *  [jwineman](https://wordpress.org/support/users/jwineman/)
 * (@jwineman)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7689148)
 * This isn’t how the feature is supposed to work. It exists to help prevent [mixed content warnings](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content).
   Not stripping https if its loaded over http is considered insecure and will trigger
   one of these warnings.
 * One possible solution is to set up a page rule on CloudFlare to force all requests
   to your blog to occur over https:
    [https://support.cloudflare.com/hc/en-us/articles/200170536-How-do-I-redirect-all-visitors-to-HTTPS-SSL-](https://support.cloudflare.com/hc/en-us/articles/200170536-How-do-I-redirect-all-visitors-to-HTTPS-SSL-)
 * Thanks,
    John
 *  [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7722397)
 * The problem with AMP validation is that CloudFlare’s HTTPS rewriting is turning
   http:// links into protocol relative // links. AMP requires a affirmative https://
   declaration.
 * I’m not saying the debate is over, but increasingly // is considered and anti-
   pattern and discouraged. [http://www.paulirish.com/2010/the-protocol-relative-url/](http://www.paulirish.com/2010/the-protocol-relative-url/)
 * CloudFlare should adopt the declarative https:// as is best practice, or make
   that the default with an option to use a protocol relative method.
 *  [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7722437)
 * Ref for “Don’t use protocol relative URLs”: [https://productforums.google.com/forum/?hl=fr#!topic/webmasters/CF5iC-p2jmw](https://productforums.google.com/forum/?hl=fr#!topic/webmasters/CF5iC-p2jmw)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘HTTPS rewriting appears to break AMP pages’ is closed to new replies.

 * ![](https://ps.w.org/cloudflare/assets/icon-256x256.png?rev=2471183)
 * [Cloudflare](https://wordpress.org/plugins/cloudflare/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cloudflare/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cloudflare/)
 * [Active Topics](https://wordpress.org/support/plugin/cloudflare/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cloudflare/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cloudflare/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Jon Brown](https://wordpress.org/support/users/jb510/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/https-rewriting-appears-to-break-amp-pages/#post-7722437)
 * Status: not resolved