• Resolved timedoorwp

    (@timedoorwp)


    Dear admins,

    I have a problem about the AMP plugin didn’t redirect the page back to amp after accessing page with ?noamp=mobile with the url.

    My website is a hybrid combination of AMP and non-AMP
    I’m using the transitional setting and using the is_amp_endpoint() function to make my theme template AMP compatible. I also using the amp_to_amp_linking_element_excluded to exclude my non-AMP pages so the link to the page will be non-AMP (contain ?noamp=mobile)

    and I found the example to use the function from a website like this

    add_filter( 'amp_to_amp_linking_element_excluded', function ( $excluded, $url ) {
      if ( 
        false !== strpos( $url, '/about' ) ||
        false !== strpos( $url, '/web-design-development' ) ||
        false !== strpos( $url, '/mobile-apps-development' ) ||
        false !== strpos( $url, '/online-marketing' ) ||
        false !== strpos( $url, '/graphic-design' ) ||
        false !== strpos( $url, '/branding-game-development' ) ||
        false !== strpos( $url, '/career' ) ||
        false !== strpos( $url, '/csr' ) ||
        false !== strpos( $url, '/contact' )
      ) {
        $excluded = true;
      }
      return $excluded;
    }, 10, 2 );

    the code work perfectly and the listed page didn’t redirect to the AMP version.
    But if I go to the AMP page (e.g. Home) from a non-AMP page, it will go to the non-AMP page. The page didn’t have ?amp=1 or ?noamp=mobile on the URL.

    I’ve tried searching in the forum and google but I can’t find any simmilar problem.

    Thank you for the time and help

    Best regards

    The page I need help with: [log in to see the link]

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

The topic ‘Web page not redirected to AMP after accessing page with ?noamp=mobile’ is closed to new replies.