Title: AMP
Last modified: December 5, 2017

---

# AMP

 *  Resolved [griddi](https://wordpress.org/support/users/griddi/)
 * (@griddi)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/amp-15/)
 * Hi!
    I’m using the plugin with AMP. Great that you support AMP in the new version,
   but unfortunately it’s not working. My blogposts URL (test system) is [https://localhost/blog/de/bmi-calculator-test/amp/](https://localhost/blog/de/bmi-calculator-test/amp/)
   The plugin tries to load an iframe from this URL [https://wwww.localhost/blog?cff-form=6&cff-form-height=500#amp=1](https://wwww.localhost/blog?cff-form=6&cff-form-height=500#amp=1).
   The URL with www doesn’t exist.
 * I have the same problem with the live version, because it’s a subdomain (blog.
   example.com) and the iframe loads from [http://www.blog.example.com](http://www.blog.example.com).
   
   How should it work?
 * Best regards

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/amp-15/#post-9751651)
 * Hello [@griddi](https://wordpress.org/support/users/griddi/),
 * I’ll try to explain how AMP works, and why we need to include or remove the “
   www.” from the original URL.
 * In the AMP pages you cannot load third party scripts, only some scripts supported
   by the AMP Project, so, in this case case you should load this pages into an `
   <amp-iframe>` tag.
 * AMP uses a sandbox for loading the page into the iframe, but you need to access
   the original session and cookies variables for multiple reasons (To verify the
   captcha, use the datasource fields, etc.), and it is here where start the trick.
 * AMP doesn’t allow to load into the `<amp-iframe>` tag, pages hosted in the same
   domain if you want sharing the cookies and sessions, for security reasons (into
   the tag is required to use the sandbox option: amp-same-origin, additional information
   in the following link: [https://github.com/ampproject/amphtml/blob/master/spec/amp-iframe-origin-policy.md](https://github.com/ampproject/amphtml/blob/master/spec/amp-iframe-origin-policy.md)).
   
   Now, for the browser these URLs are in different domains:
 * [http://your-website-domain.com](http://your-website-domain.com)
 * and
 * [http://www.your-website-domain.com](http://www.your-website-domain.com)
 * So, if the user visits the URL [http://your-website-domain.com](http://your-website-domain.com),
   the plugin tries to load into the `<amp-iframe>` tag the URL [http://www.your-website-domain.com](http://www.your-website-domain.com)
   to satisfy the “amp-same-origin” restriction, and then, internally redirect the
   webpage to the original URL [http://your-website-domain.com](http://your-website-domain.com).
   The same occurs in the other direction, if the user visits the URL [http://www.your-website-domain.com](http://www.your-website-domain.com),
   it tries to load into the `<amp-iframe>` tag the URL [http://your-website-domain.com](http://your-website-domain.com)
   to satisfy the “amp-same-origin” rules, and then, internally redirect the user
   to the webpage: [http://www.your-website-domain.com](http://www.your-website-domain.com)
 * I know the explanation can be confuse.
 * My recommendation would be configure your website for accepting both URLs:
 * [http://your-website-domain.com](http://your-website-domain.com)
    and [http://www.your-website-domain.com](http://www.your-website-domain.com)
 * Best regards.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/amp-15/#post-9751697)
 * Hello,
 * I’m sorry, in the previous ticket all the URLs must be https
 * Best regards.

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

The topic ‘AMP’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [subdomain](https://wordpress.org/support/topic-tag/subdomain/)

 * 2 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/amp-15/#post-9751697)
 * Status: resolved