Slash at the end
-
Categories and posts have incorrect links to their AMP-pages – no slash “/” at the end. Though in the code such link is specified – <link rel=”amphtml” href=”https://domain.com/category/amp/” /> and <link rel=”amphtml” href=”https://domain.com/post/amp/” />
This may cause problems with duplicate pages. On the homepage everything is correct.
-
This is what the problem is in detail.
Homepage:
- In the code:
<link rel="amphtml" href="domain.com/amp/" />
domain.com/amp/
– HTTP header 200domain.com/amp
– HTTP header 301 Moved Permanently ->domain.com/amp/
- All links in the AMP version lead to
domain.com/amp
[WRONG!]
Category:
- In the code:
<link rel="amphtml" href="domain.com/category/amp/" />
domain.com/category/amp/
– HTTP header 301 Moved Permanently ->domain.com/category/amp
[WRONG!]domain.com/category/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/category/amp/
Posts:
- In the code:
<link rel="amphtml" href="domain.com/post/amp/" />
domain.com/post/amp/
– HTTP header 301 Moved Permanently ->domain.com/post/amp
[WRONG!]domain.com/post/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/post/amp/
Pages:
- In the code:
<link rel="amphtml" href="domain.com/page/amp/" />
domain.com/page/amp/
– HTTP header 301 Moved Permanently ->domain.com/page/amp
[WRONG!]domain.com/page/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/page/amp/
Hi @exsith,
Thanks for pointing issue out and sorry for the inconvenience.
We’ll fix it in our next minor release. Will notify you once it’s released.
Thanks
Hi @exsith,
Incorrect links to AMP Pages have been resolved resolved in our latest release.
Let us know if you have any further questions/concerns.
Thanks,
Homepage:
- All OK!
Category:
- In the code:
<link rel="amphtml" href="domain.com/category/amp/" />
[OK!] domain.com/category/amp/
– HTTP header 301 Moved Permanently ->domain.com/category/amp
[WRONG!]domain.com/category/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/category/amp/
[OK!]
Posts:
- In the code:
<link rel="amphtml" href="domain.com/post/amp/" />
[OK!] domain.com/post/amp/
– HTTP header 301 Moved Permanently ->domain.com/post/amp
[WRONG!]domain.com/post/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/post/amp/
[OK!]
Pages:
- In the code:
<link rel="amphtml" href="domain.com/page/amp/" />
[OK!] domain.com/page/amp/
– HTTP header 301 Moved Permanently ->domain.com/page/amp
[WRONG!]domain.com/page/amp
– HTTP header 200 [WRONG!]- All links in the AMP version lead to
domain.com/page/amp/
[OK!]
Hi @exsith,
Everything is working perfectly fine at out demo server. Can you please share reference URLs where these links are causing issue?
Thanks,
If your demo site is https://demo.ampwp.io/amp/ then there is a slash at the beginning and not at the end.
Sorry not sure what you mean? Could be please elaborate further.
Your demo server is https://demo.ampwp.io/amp/, right? If it is, then there is a slash at the beginning, in this case there will be no errors. And I mean when the slash is at the end.
After updating the problem is the same as before. In all three types of taxonomies (categories, pages and posts) in the code there is a slash at the end (as it should be), but at the same time, when checking HTTP response headers it gives 301 Moved Permanently. And the redirect goes to the address without a slash https://prnt.sc/ma073q
Can you fix this?- This reply was modified 5 years, 3 months ago by exsith.
Hi @exsith,
Can you please tell us from where (website or any other third party service) you’re checking HTTP response headers?
Thanks,
https://headers.cloxy.net/
On any other service, the check gives the same results.The problem occurs only when the plugin is set to show a slash at the end of the address, while on your online demo slash is at the beginning.
Hi @exsith,
Slash mean AMP?
The slash symbol “/” at the end of the URL.
For example,https://test.com/post/amp/
Hi @exsith,
I am sorry but I am bit confuse. Can you please guide (step by step) me how can I set slash at the end of my online demo.
By the way, this is my online demo headers result.
- This reply was modified 5 years, 3 months ago by Mohsin Rafique.
- Here are the plugin settings, the value “AMP URL Format” is set as “End Point – At the end of URL” https://prnt.sc/maxy0e
- In the code of the category, page and post this line https://prnt.sc/maxyrx
- At the same time, the URL of such a page (with slash at the end) gives an incorrect HTTP header with the code 301 Moved permanently http://prntscr.com/may0cw
- And redirects to the page without a slash, which is wrong https://prnt.sc/may0zm
- In the code:
- The topic ‘Slash at the end’ is closed to new replies.