{"id":18670,"date":"2021-06-15T13:18:42","date_gmt":"2021-06-15T10:18:42","guid":{"rendered":"https:\/\/plumrocket.com\/docs\/?p=18670"},"modified":"2021-09-21T09:14:02","modified_gmt":"2021-09-21T13:14:02","slug":"loading-product-options-gets-stuck-in-the-amp-iframe","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","title":{"rendered":"Loading Product Options Gets Stuck in the AMP Iframe"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The message&nbsp;<strong>\u201cLoading Product Options\u201d<\/strong>&nbsp;is displayed on&nbsp;<a href=\"https:\/\/plumrocket.com\/magento-amp\">Magento 2 AMP<\/a>&nbsp;pages, the loader gets stuck spinning and never loads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please see the screenshot below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1.png\" alt=\"Amp-loading-options.png\" class=\"wp-image-18960\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1-768x455.png 768w\" sizes=\"auto, (max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Another way to debug this issue is by opening the Iframe source in a new window. The browser will display the following error message:&nbsp;<span class=\"has-blue-color\"><em>\u201cThis page isn&#8217;t working. Domain.com redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.\u201d<\/em><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1.png\" alt=\"Page-not-working.png\" class=\"wp-image-18959\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1-768x455.png 768w\" sizes=\"auto, (max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Issue Description<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The issue happens when website redirects are configured in your web server affecting the ampiframe.php file. In most cases, the 301\/302 rewrite rule redirecting non-www to the www version of the website will cause the AMP Iframe to fail to load.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution 1 (Recommended)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Disable the 301\/302 redirects in your webserver affecting the&nbsp;<strong>ampiframe.php<\/strong>&nbsp;file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disable Apache Web Server Redirects<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using an Apache web server, find and edit your <strong>httpd.conf<\/strong> and <strong>.htaccess<\/strong> files:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\" data-line=\"\">vi \/path\/to\/magento2\/.htaccess\nvi \/path\/to\/magento2\/pub\/.htaccess\nvi \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remove or comment <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/rewrite\/remapping.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">redirects similar to these:<\/a><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div class=\"prism-title\">httpd.conf or .htaccess<\/div><pre><code class=\"\" data-line=\"\">RewriteCond %{HTTP_HOST} !^www\\. [NC]\nRewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/$1 [R=301,L]\n\nRewriteCond %{HTTP_HOST} ^www\\.(.*)$ [NC]\nRewriteRule ^(.*)$ http:\/\/%1\/$1 [R=301,L]<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disable Nginx Web Server Redirects<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using a Nginx web server, find and edit your&nbsp;<strong>virtual host<\/strong>&nbsp;file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">vi \/etc\/nginx\/sites-available\/&lt;domain.com&gt;.conf<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Remove or comment similar\u00a0<a href=\"http:\/\/nginx.org\/en\/docs\/http\/converting_rewrite_rules.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">rewrite rules:<\/a><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\"> server {\n listen 80;\n server_name domain.com;\n return 301 http:\/\/www.domain.com$request_uri;\n }<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Then\u00a0<a href=\"https:\/\/docs.magento.com\/user-guide\/configuration\/general\/web.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">enable the Auto-redirect to Base URL<\/a>\u00a0in your Magento backend:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to&nbsp;<strong>Configuration &gt; Web &gt; Auto-redirect to Base URL<\/strong>&nbsp;and make sure that you have a 302 (or 301) redirect enabled in Magento settings. This setting prevents duplicate content issues in Google.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1206\" height=\"600\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1.png\" alt=\"Auto-redirect.png\" class=\"wp-image-18957\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1-300x149.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1-1024x509.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1-768x382.png 768w\" sizes=\"auto, (max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now go back to your browser and refresh the AMP product page. The AMP Iframe should be displayed correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution 2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Another way to solve webserver redirect issues for AMP Iframe is to exclude&nbsp;<strong>ampiframe.php<\/strong>&nbsp;from 301\/302 redirects.<br><br><strong>Exclude ampiframe.php From Apache Web Server Redirects<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using an Apache web server, find and edit your&nbsp;<strong>httpd.conf<\/strong>&nbsp;and&nbsp;<strong>.htaccess<\/strong>&nbsp;files:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">vi \/path\/to\/magento2\/.htaccess\nvi \/path\/to\/magento2\/pub\/.htaccess\nvi \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Add ONE of the following changes to your Apache redirects<\/strong>:<br><br><strong>Option 1:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add line &#8220;<span class=\"has-blue-color\"><em>RewriteCond&nbsp;%{REQUEST_URI}&nbsp;!^\/ampiframe.php<\/em><\/span>&#8221; as shown below:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">RewriteEngine on\nRewriteCond %{REQUEST_URI} !^\/ampiframe.php\nRewriteRule (.*) https:\/\/www.domain.com\/$1 [R=301,L]<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong>Option 2:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following line at the top of your rewrite rules before any other calls&nbsp;:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">RewriteRule ^(ampiframe.php) - [L]<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong>Option 3:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Replace your existing redirect rule with the following:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">RedirectMatch 301 ^\/((?!ampiframe.php).*)$ https:\/\/www.domain.com\/$1<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li>domain.com &#8211; is your Magento store domain name<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Exclude ampiframe.php From Nginx Web Server Redirects<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using a Nginx web server, find and edit your&nbsp;<strong>virtual host<\/strong>&nbsp;file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">vi \/etc\/nginx\/sites-available\/&lt;domain.com&gt;.conf<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Add location block &#8220;<span class=\"has-blue-color\"><em>location \/ampiframe.php<\/em><\/span>&#8221; as shown below:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"\" data-line=\"\">server {\n \n listen 80;\n server_name www.domain.com domain.com;\n \n location \/ {\n # redirect to https version of the domain\n return 301 https:\/\/www.domain.com$request_uri;\n }\n \n location \/ampiframe.php {\n # Do nothing. Nginx will exclude the amp-iframe file from redirect\n root \/path\/to\/webroot;\n }\n \n}<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is displayed on&nbsp;Magento 2 AMP&nbsp;pages, the loader gets stuck spinning and never loads. Please see the screenshot below: Another way to debug this issue is by opening the Iframe source in a new window. The browser will display &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Loading Product Options Gets Stuck in the AMP Iframe&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[106],"tags":[],"class_list":["post-18670","post","type-post","status-publish","format-standard","hentry","category-troubleshooting-v3","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Loading Product Options Gets Stuck in the AMP Iframe - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Loading Product Options Gets Stuck in the AMP Iframe - Plumrocket Documentation\" \/>\n<meta property=\"og:description\" content=\"Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-15T10:18:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-21T13:14:02+00:00\" \/>\n<meta name=\"author\" content=\"Plumrocket\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Loading Product Options Gets Stuck in the AMP Iframe - Plumrocket Documentation","description":"Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","og_locale":"en_US","og_type":"article","og_title":"Loading Product Options Gets Stuck in the AMP Iframe - Plumrocket Documentation","og_description":"Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is","og_url":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","og_site_name":"Plumrocket Documentation","article_published_time":"2021-06-15T10:18:42+00:00","article_modified_time":"2021-09-21T13:14:02+00:00","author":"Plumrocket","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#article","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck"},"author":{"name":"Plumrocket","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20"},"headline":"Loading Product Options Gets Stuck in the AMP Iframe","datePublished":"2021-06-15T10:18:42+00:00","dateModified":"2021-09-21T13:14:02+00:00","mainEntityOfPage":{"@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck"},"wordCount":423,"articleSection":["Troubleshooting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","url":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","name":"Loading Product Options Gets Stuck in the AMP Iframe - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2021-06-15T10:18:42+00:00","dateModified":"2021-09-21T13:14:02+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20"},"description":"Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d The message&nbsp;\u201cLoading Product Options\u201d&nbsp;is","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 AMP","item":"https:\/\/plumrocket.com\/magento-amp"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-amp"},{"@type":"ListItem","position":4,"name":"v3","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3"},{"@type":"ListItem","position":5,"name":"Troubleshooting","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v3\/troubleshooting"},{"@type":"ListItem","position":6,"name":"Loading Product Options Gets Stuck in the AMP Iframe"}]},{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20","name":"Plumrocket","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/85ed2f38dbe6a031f443b1949101e9b31bbd6985eae2cac6695629e7ad280aee?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/85ed2f38dbe6a031f443b1949101e9b31bbd6985eae2cac6695629e7ad280aee?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/85ed2f38dbe6a031f443b1949101e9b31bbd6985eae2cac6695629e7ad280aee?s=96&d=mm&r=g","caption":"Plumrocket"},"sameAs":["https:\/\/plumrocket.com\/docs"]}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=18670"}],"version-history":[{"count":2,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18670\/revisions"}],"predecessor-version":[{"id":24193,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18670\/revisions\/24193"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=18670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=18670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=18670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}