better-studio / better-amp

Full Google AMP support for WordPress with custom themes and customizations
https://betterstudio.com/wp-plugins/better-amp/
GNU General Public License v2.0
19 stars 19 forks source link

wrong permalink in rel=alternate #48

Open depasco opened 6 years ago

depasco commented 6 years ago

Hi support team,

my permalinks look like this: /%postname%/ with a closing trailing slash at the end. Your plugin does not add the slash at the end of the link rel="amphtml" href= url If the url of the page is https://www.domain.com/newpage/ your plugin inserts link rel="amphtml" href="https://www.domain.com/amp/newpage" which leads to a 404 error. I have a 301 force redirect for urls without trailing slash at the end in my htaccess but it's ugly and leads to 301 redirect if any bot crawls the site. Can you please fix this ? Many thanks...

Best Regards, Markus

tarek-helish commented 6 years ago

hello i have sam problem on my site you can check that https://www.masa-jaddah.com but i fix that error you have to go to this file on better-amp( better-amp/includes/functions/theme-functions.php ) and open it and go to line number 1100 you will see that

replace with that

and save the file the problem gone i wish i help you have a nice day