{"id":17614,"date":"2021-03-08T16:15:56","date_gmt":"2021-03-08T16:15:56","guid":{"rendered":"http:\/\/wiki2.plumserver.com\/?post_type=ht_kb&#038;p=17614"},"modified":"2021-09-21T08:52:21","modified_gmt":"2021-09-21T12:52:21","slug":"loading-product-options-gets-stuck","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/troubleshooting\/amp-iframe-options-stuck","title":{"rendered":"Loading Product Options Gets Stuck in the AMP Iframe"},"content":{"rendered":"\n<h2>Loading Product Options Gets Stuck. Browser Displays Error: \u201cDomain.com redirected you too many times.\u201d<\/h2>\n\n\n\n<p>The message&nbsp;<strong>\u201cLoading Product Options\u201d<\/strong>&nbsp;is displayed on <a href=\"\/magento-amp\">Magento 2 AMP<\/a> pages, the loader gets stuck spinning and never loads.<\/p>\n\n\n\n<p>Please see the screenshot below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png\" alt=\"Amp-loading-options.png\" class=\"wp-image-18952\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options-768x455.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<p>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\" width=\"1206\" height=\"714\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working.png\" alt=\"Page-not-working.png\" class=\"wp-image-18954\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-300x178.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-1024x606.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Page-not-working-768x455.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2>Issue Description<\/h2>\n\n\n\n<p>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>Solution 1 (Recommended)<\/h2>\n\n\n\n<h3>Step 1<\/h3>\n\n\n\n<p>Disable the 301\/302 redirects in your webserver affecting the&nbsp;<strong>ampiframe.php<\/strong>&nbsp;file<\/p>\n\n\n\n<p><strong>Disable Apache Web Server Redirects<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p>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<pre class=\"wp-block-preformatted\">vi \/path\/to\/magento2\/.htaccess\nvi \/path\/to\/magento2\/pub\/.htaccess\nvi \/etc\/httpd\/conf\/httpd.conf<\/pre>\n\n\n\n<p><br>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<pre class=\"wp-block-preformatted\">RewriteCond %{HTTP_HOST} !^www\\. [NC]\nRewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}\/$1 [R=301,L]<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteCond %{HTTP_HOST} ^www\\.(.*)$ [NC]\nRewriteRule ^(.*)$ http:\/\/%1\/$1 [R=301,L]<\/pre>\n<\/div><\/div>\n\n\n\n<p><strong>Disable Nginx Web Server Redirects<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p>If you are using a Nginx web server, find and edit your&nbsp;<strong>virtual host<\/strong>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>vi<\/strong> <strong>\/<\/strong>etc<strong>\/<\/strong>nginx<strong>\/<\/strong>sites-available<strong>\/&lt;<\/strong>domain.com<strong>&gt;<\/strong>.conf<\/pre>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"> server <strong>{<\/strong>\n listen 80;\n server_name domain.com;\n <strong>return<\/strong> 301 http:<strong>\/\/<\/strong>www.domain.com$request_uri;\n <strong>}<\/strong><\/pre>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div><\/div>\n\n\n\n<h3>Step 2<\/h3>\n\n\n\n<p>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>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\" width=\"1206\" height=\"600\" src=\"\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect.png\" alt=\"Auto-redirect.png\" class=\"wp-image-18955\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-300x149.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-1024x509.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Auto-redirect-768x382.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3>Step 3<\/h3>\n\n\n\n<p>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>Solution 2<\/h2>\n\n\n\n<p>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<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p>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<pre class=\"wp-block-preformatted\"><strong>vi<\/strong> <strong>\/<\/strong>path<strong>\/<\/strong>to<strong>\/<\/strong>magento2<strong>\/<\/strong>.htaccess\n<strong>vi<\/strong> <strong>\/<\/strong>path<strong>\/<\/strong>to<strong>\/<\/strong>magento2<strong>\/<\/strong>pub<strong>\/<\/strong>.htaccess\n<strong>vi<\/strong> <strong>\/<\/strong>etc<strong>\/<\/strong>httpd<strong>\/<\/strong>conf<strong>\/<\/strong>httpd.conf<\/pre>\n\n\n\n<p><strong>Add ONE of the following changes to your Apache redirects<\/strong>:<br><br><strong>Option 1:<\/strong><\/p>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\">RewriteEngine on\nRewriteCond <strong>%<\/strong><strong>{<\/strong>REQUEST_URI<strong>}<\/strong> <strong>!<\/strong>^<strong>\/<\/strong>ampiframe.php\nRewriteRule <strong>(<\/strong>.<strong>*<\/strong><strong>)<\/strong> https:<strong>\/\/<\/strong>www.domain.com<strong>\/<\/strong>$1 <strong>[<\/strong>R=301,L<strong>]<\/strong><\/pre>\n\n\n\n<p><br><strong>Option 2:<\/strong><\/p>\n\n\n\n<p>Add the following line at the top of your rewrite rules before any other calls&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteRule ^<strong>(<\/strong>ampiframe.php<strong>)<\/strong> - <strong>[<\/strong>L<strong>]<\/strong><\/pre>\n\n\n\n<p><br><strong>Option 3:<\/strong><\/p>\n\n\n\n<p>Replace your existing redirect rule with the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RedirectMatch 301 ^<strong>\/<\/strong><strong>(<\/strong><strong>(<\/strong>?<strong>!<\/strong>ampiframe.php<strong>)<\/strong>.<strong>*<\/strong><strong>)<\/strong>$ https:<strong>\/\/<\/strong>www.domain.com<strong>\/<\/strong>$1<\/pre>\n\n\n\n<ul><li>domain.com &#8211; is your Magento store domain name<\/li><\/ul>\n<\/div><\/div>\n\n\n\n<p><strong>Exclude ampiframe.php From Nginx Web Server Redirects<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p>If you are using a Nginx web server, find and edit your&nbsp;<strong>virtual host<\/strong>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>vi<\/strong> <strong>\/<\/strong>etc<strong>\/<\/strong>nginx<strong>\/<\/strong>sites-available<strong>\/&lt;<\/strong>domain.com<strong>&gt;<\/strong>.conf<\/pre>\n\n\n\n<p>Add location block &#8220;<span class=\"has-blue-color\"><em>location \/ampiframe.php<\/em><\/span>&#8221; as shown below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server <strong>{<\/strong>\n&nbsp;\n listen 80;\n server_name www.domain.com domain.com;\n&nbsp;\n location <strong>\/<\/strong> <strong>{<\/strong>\n <em># redirect to https version of the domain<\/em>\n <strong>return<\/strong> 301 https:<strong>\/\/<\/strong>www.domain.com$request_uri;\n <strong>}<\/strong>\n&nbsp;\n location <strong>\/<\/strong>ampiframe.php <strong>{<\/strong>\n <em># Do nothing. Nginx will exclude the amp-iframe file from redirect<\/em>\n root <strong>\/<\/strong>path<strong>\/<\/strong>to<strong>\/<\/strong>webroot;\n <strong>}<\/strong>\n&nbsp;\n<strong>}<\/strong><\/pre>\n<\/div><\/div>\n\n\n\n<p><\/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 Magento 2 AMP 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/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":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[105],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\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\" \/>\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=\"\/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-03-08T16:15:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-21T12:52:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png\" \/>\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 Premium 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","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":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck","og_site_name":"Plumrocket Documentation","article_published_time":"2021-03-08T16:15:56+00:00","article_modified_time":"2021-09-21T12:52:21+00:00","og_image":[{"url":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@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":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#primaryimage","inLanguage":"en-US","url":"\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png","contentUrl":"\/docs\/wp-content\/uploads\/2021\/06\/Amp-loading-options.png"},{"@type":"WebPage","@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#webpage","url":"\/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"},"primaryImageOfPage":{"@id":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#primaryimage"},"datePublished":"2021-03-08T16:15:56+00:00","dateModified":"2021-09-21T12:52:21+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"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":"\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["\/docs\/magento-amp\/v3\/troubleshooting\/amp-iframe-options-stuck"]}]},{"@type":"BreadcrumbList","@id":"\/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":"v2","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2"},{"@type":"ListItem","position":5,"name":"Troubleshooting","item":"https:\/\/plumrocket.com\/docs\/magento-amp\/v2\/troubleshooting"},{"@type":"ListItem","position":6,"name":"Loading Product Options Gets Stuck in the AMP Iframe"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17614"}],"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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=17614"}],"version-history":[{"count":2,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17614\/revisions"}],"predecessor-version":[{"id":24185,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/17614\/revisions\/24185"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=17614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=17614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=17614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}