One of the Joomla 3 templates I use on a multilingual website generates wrong href tag links in the HTML header and also in the body. The href on all multilingual pages reads:
in the HEAD link href="https://domain/page?layout=post" rel="alternate" hreflang="en-GB" /> in the BODY a href="/fr/page?layout=post">
and should be
link href="https://domain/page" rel="alternate" hreflang="en-GB" /> and a href="/fr/page">
I have currently used a temporary rewrite of the .htaccess file; however, that generated hundreds of 301 redirects and I am sure that is not a good SEO solution.
Because it will take some time for finding the origin and permanently correcting the code, I need some help with PHP to remove the string ?layout=post and showing the correct href links in the and .
2
Answers
My guess is you need to go to Joomla settings and enable Search Engine Friendly URLs
And only after this you should modify .htaccess file.
This should solve your problem, if it didn’t that it is maybe as you say a template issue but then you have to look it in a template files witch take some time from you.
this is the version I’m using.
I make it on clean php.
Copy this code and paste to php compiler online to show how it work.
And use
strtok('Your link with get parameter', '?');
to delete get parameters!