Support » Plugin: AMP for WP - Accelerated Mobile Pages » Ugly internal links – ?q=/

  • Resolved YuriV

    (@yuriv)


    Hi,

    Just installed 0.9.97.4 but we’ll have to revert to an older version again. This because of strange internal links in the new version of the AMP-pages. Internal links suddenly had formats like:

    http:://DOMAIN.com/title/amp/?q=/title/

    That’s ugly, I guess no good for SEO-reason and maybe causing CPU-load as well.

    Hope you guys can take a look at it.

    Thanks in advance,

    Yuri

    PS: Auto Ads still didn’t work in 0.9.97.4.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Author Mohammed Kaludi

    (@mohammed_kaludi)

    That’s extremely strange! I apologise for that!

    Can you please contact me on team@magazine3.com ?
    I will make sure that this issue gets fixed immediately!

    Plugin Author Mohammed Kaludi

    (@mohammed_kaludi)

    Also, Was this the same case with 0.9.97.3 ?

    Hi.

    Same issue on my website. With 0.9.97.3 and 0.9.97.5.

    Plugin Contributor ampforwp

    (@ampforwp)

    Hey Yuriv,

    Thank you for the information.

    I understand your query, further, I would recommend you to contact us on team@magazine3.com.

    our team will debug and make sure that everything is working fine for you.

    I have updated to Version 0.9.97.6 (released 2 days ago) and issue remains.

    Same here

    Plugin Contributor ampforwp

    (@ampforwp)

    Hey Yuriv,

    Thank you for contacting us on team@magazine.com, I see that one of our team members is assisting you on this query and requires further information, could you check your e-mail and revert back with the same.

    Plugin Contributor ampforwp

    (@ampforwp)

    Hey Eric_draven,

    I would recommend you to contact us at team@magazine3.com.

    Our team will debug and make sure that everything is working fine for you.

    Hi ampforwp,

    We provided WP-credentials but the team needed FTP-access as well. Because of our security policy we can’t provide this access. We’re using an older version of the plugin right now and hope this issue will be fixed in one of your future updates.

    Regards, Yuri

    Hi @yuriv, Which version? I tried 0.9.97.3.

    I’m back at 0.9.96

    I’ve found that ugly url with ?q= in link rel=”amphtml” produced by ampforwp_url_purifier($url) function in templates/features.php this code:

    if ( is_singular() && !empty($_SERVER['QUERY_STRING']) ) {
    	$query_arg 	= wp_parse_args($_SERVER['QUERY_STRING']);
    	$url 		= add_query_arg( $query_arg, $url);
    }

    I’m running the latest version of plugin and use NGINX web server.

    • This reply was modified 1 year, 1 month ago by  Mike.
    • This reply was modified 1 year, 1 month ago by  Mike.

    Retried an update of the plugin this morning since I saw this in the changelog of 0.9.97.7:

    Fixed: AMP renders with ?q after the /amp #2361

    Unfortunately the problem still exists on my end. Rolled back to 0.9.96.

    hey guys

    can you replace the code in the if ( is_singular() && !empty($_SERVER['QUERY_STRING']) ) condition of function ampforwp_url_purifier($url) as pointed by @mixar with the following code and check?

    global $wp_query;
          $query_arg   = wp_parse_args($_SERVER['QUERY_STRING']);
          $query_name = $wp_query->query['name'];
          if(strpos($_SERVER['QUERY_STRING'],$query_name) && (isset($query_arg['q']) && strpos($query_arg['q'],$query_name))){
              $query_arg = str_replace($query_name, '', $query_arg);
              unset($query_arg['q']);
            }
          
          $url     = add_query_arg( $query_arg, $url);

    This should resolve the issue, please do let us know as we’ll be releasing an update soon along with this code.

    Thanks @sejiro with you code all works fine. We don’t need additional global $wp_query; because its already present in ampforwp_url_purifier($url) function.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Ugly internal links – ?q=/’ is closed to new replies.