• I also have a TAG called “nebosh” (I do not generate amp pages for tags via settings) – when visiting the amp for I get redirected back to the page without amp. It’s a 302 redirect, I’ve checked all my redirect rules on my server and in software (I use Yoast) and I can confirm none of the rules are causing this cyclical redirect.

    FYI I used a page and I have a tag “nebosh”, but no tag base!

    I performed some tests and realised that in the wp-options database table, there’s a field called “rewrite_rules” which contains a number of amp replated rules; and this includes my TAG of “nebosh” that I also use within the rules – like this snippet from my table:

    s:15:"(nebosh)/amp/?$";s:29:"index.php?amp&tag=$matches[1]";s:33:"(nebosh)/amp/page/?([0-9]{1,})/?$";s:47:"index.php?amp&tag=$matches[1]&paged=$matches[2]";

    When I turn the option on to add amp to my TAGs and visit here: /amp/ I’m shown all posts with the “nebosh” tag.

    If I add a TAG base url of sheilds.org/tag/ first, then visit sheilds.org/tag/nebosh/amp/ this page works and shows for tag related posts, but visiting sheilds.org/nebosh/amp/ also just shows the same TAG-related posts, not the individual page with an amp variant.

    So I have identified an issue that if you have a tag with the same name as the landing url, this causes a problem and never shows the individual page, just the collection posts using that tag.

    Any advice on how to fix this? seems like a coding issue to me.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor ampforwp

    (@ampforwp)

    Hi @stevepb,

    Did you enable the ‘tag base remove in AMP’ option from the Advanced settings? If not, can you please enable this option and check whether the issue is resolved or not.

    You will find this option in AMP > settings > Advanced setting > tag base remove in AMP.

    Screenshot: http://take.ms/B5Czs

    Hope it helps.

    Thread Starter stevepb

    (@stevepb)

    Hi,

    Yes, Tag base was disabled in the first place (I’ve always had this option off). Although I tried turning it on/off and experimenting, but get the same result.

    I suspect I will receive the same result for any, one word TAG that is also an url page/post on my site.

    I know this is separate, but when editing some AMP pages using the builder this has been completely crashing out my site upon saving (not all the time, certain pages are problematic, such as this page I’m editing). I have to restart apache to fix this. Although there were instances where I had to rename your plugin just to get my site up and running even after an apache/php +phpfpm restart.

    Thanks for your support

    Thread Starter stevepb

    (@stevepb)

    Ok, Just tried turning the tag base off this morning, low and behold! I now see this amp page here: <

    I’m thinking a caching issue may have prevented my site from correctly showing the amp page in a timely manner. I use WP Rocket and an external Website Application Firewall with CDN and caching.

    Not sure about the constant page crashes when saving, but maybe this was also related to caching??

    Since viewing the amp page is now working, it also seems saving amp pages is no longer crashing my site 🙂

    Again, thanks for your support

    • This reply was modified 5 years, 7 months ago by stevepb.
    Thread Starter stevepb

    (@stevepb)

    OK, my site is still crashing when saving some AMP pages. I’ve checked my logs and can see that the when using a video element in page builder it takes the url of the video (which my video ends in .mp4) and tries to load it as .jpg – the file doesn’t exist as it’s a .mp4. So that’s one minor error I spotted but that alone shouldn’t take down my site. In-fact it’s also looking for .webm and .ogv also, but these variants do not exist – it seems that the video element of page builder is trying to locate all media types – but .jpg shouldn’t be one, considering the options offer the possibility to set your own placeholder image.

    Another error I see is related to amp-tca plugin

    AH01071: Got error 'PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/domain.org/https/wp-content/plugins/amp-cta/amp-cta.php on line 356\nPHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/domain.org/https/wp-content/plugins/amp-cta/amp-cta.php on line 255\n'

    There are no other useful logs, although there are errors for WP Rocket plugin, which is a caching plugin.

    When editing a particular pages’ amp builder and saving, this 100% of the time crashes my site.

    Any ideas?

    Plugin Contributor ampforwp

    (@ampforwp)

    Hi @stevepb,

    Regarding the crashing when saving some AMP pages, this issue is really strange. Can you please contact us directly on team@magazine3.com? our technical team will check and debug the issue immediately.

    And for the CTA plugin issue, please mention this also in the email. From there, our extension team will check and resolve the issue immediately.

    And also please mention this thread in the email.

    Thread Starter stevepb

    (@stevepb)

    Hello ampforwp, I have emailed your support team and detailed the issues.

    I managed to fix issues with cta and have explained I correct the problem to your team.

    I have fixed other plugins (WP Rocket) errors and realise they are not related or conflicting with your amp plugin.

    I have realised that when saving pages the amp plugin is requesting too many input vars. Basically, it’s exceeding my servers max_input_vars 1000 limit. 1000 max_input_vars is default setting in php.ini for most LAMP servers and I find it strange your plugin wants more than that limit.

    I can obviously increase my max_inpput_vars limit, however I would think this is better resolved with optimised coding of the plugin.

    Either way I am prepared to increase this limit for now, until you’ve made some further improvements to the code/plugin release. I can then set it back to a nominal value, i.e. back to 1000. Do you know how many input vars your plugin is requesting and I’ll change my server limit to that value.

    Thanks for your support

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tag name same as page name – redirect issue’ is closed to new replies.