@the5krunner I’m still seeing the JavaScript-based redirection being done. Specifically, your non-AMP page at https://fitium.nl has this script at the top:
<script>!function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r){!function(e){var r=e.ampUrl,n=e.isCustomizePreview,t=e.isAmpDevMode,o=e.noampQueryVarName,a=e.noampQueryVarValue,i=e.disabledStorageKey,u=e.mobileUserAgents,s=e.regexRegex;if("undefined"!=typeof sessionStorage){var f=new RegExp(s);if(u.some((function(e){var r=e.match(f);if(r&&new RegExp(r[1],r[2]).test(navigator.userAgent))return!0;return navigator.userAgent.includes(e)}))){document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("amp-mobile-version-switcher");if(e){e.hidden=!1;var r=e.querySelector("a[href]");r&&r.addEventListener("click",(function(){sessionStorage.removeItem(i)}))}}));var c=t&&["paired-browsing-non-amp","paired-browsing-amp"].includes(window.name);if(!(sessionStorage.getItem(i)||n||c)){var d=new URL(location.href),l=new URL(r);l.hash=d.hash,d.searchParams.has(o)&&a===d.searchParams.get(o)?sessionStorage.setItem(i,"1"):l.href!==d.href&&(window.stop(),location.replace(l.href))}}}}({"ampUrl":"https:\/\/fitium.nl\/?amp=1","noampQueryVarName":"noamp","noampQueryVarValue":"mobile","disabledStorageKey":"amp_mobile_redirect_disabled","mobileUserAgents":["Mobile","Android","Silk\/","Kindle","BlackBerry","Opera Mini","Opera Mobi"],"regexRegex":"^\\/((?:.|\n)+)\\/([i]*)$","isCustomizePreview":false,"isAmpDevMode":false})}]);</script>
This script should not be added (for unauthenticated users) when this code is present:
add_filter( 'amp_mobile_client_side_redirection', '__return_false' );
I tried adding it to a test site of mine, and when I accessed the site in an incognito window, the script is indeed not added to the page. When I access the page in mobile, I am redirected to the AMP version via HTTP redirect as expected, instead of a JS-based redirect.