Page 1 of 1
URL Rewrite for anchor link
Posted: Wed Apr 08, 2020 12:27 pm
by mariostg
Good day.
I am using URL rewrite, it works fine except for anchors. It redirect to the home page. I use TinyMCE interface to create the anchor which let me pick an anchor from the page.
A link with anchor that should be like:
Code: Select all
https://www.mariostg.com/club/Nous_connaitre/autres_ressources#Quebec
result to:
https://www.mariostg.com/club/#Quebec
I am on 2.2.12
Thanks
Re: URL Rewrite for anchor link
Posted: Wed Apr 08, 2020 3:34 pm
by DIGI3
You might need to check the base href tag in your source. By default it's created in the {metadata} tag but you may need to disable that and create it manually, see
https://docs.cmsmadesimple.org/configur ... g_showbase
This is just a guess, I haven't experimented with what TinyMCE does for anchors. It might also be that you need to be more strict with your rewrites - but that's out of the scope of cmsms support (feel free to post your rewrites and resulting html in the Lounge if you want the community to help though)
Re: URL Rewrite for anchor link
Posted: Thu Apr 09, 2020 1:03 pm
by mariostg
There is not much in the {metadata} tag. TinyMCE simple add #AnchorName. But in reality, it should do something like #CurrentPagePath/PageName.
I will do that manually for now. Thanks.
Re: URL Rewrite for anchor link
Posted: Fri Apr 10, 2020 10:23 am
by velden
Like DIGI3 mentions, the base tag (which by default is generated by the
metadata tag) does ruin the use of those anchors.
Removing the base tag though can result in other problems. So if you remove it make sure to test other pages/functionality carefully before going live.
Re: URL Rewrite for anchor link[Solved - somewhat]
Posted: Mon Apr 13, 2020 7:12 pm
by mariostg
Not interested in breaking things down for now. Maybe when I get more familiar with the innards.

Re: URL Rewrite for anchor link
Posted: Tue Apr 14, 2020 10:49 am
by velden
Sure.
By the way note that it's not a CMSMS 'issue' but the behavior of browsers based on html standards.
https://www.w3.org/html/wiki/Elements/base