URL Rewrite for anchor link

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
mariostg
Forum Members
Forum Members
Posts: 12
Joined: Wed Apr 08, 2020 12:10 pm

URL Rewrite for anchor link

Post 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
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1800
Joined: Wed Feb 25, 2009 4:25 am

Re: URL Rewrite for anchor link

Post 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)
Not getting the answer you need? CMSMS support options
mariostg
Forum Members
Forum Members
Posts: 12
Joined: Wed Apr 08, 2020 12:10 pm

Re: URL Rewrite for anchor link

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: URL Rewrite for anchor link

Post 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.
mariostg
Forum Members
Forum Members
Posts: 12
Joined: Wed Apr 08, 2020 12:10 pm

Re: URL Rewrite for anchor link[Solved - somewhat]

Post by mariostg »

Not interested in breaking things down for now. Maybe when I get more familiar with the innards. ::)
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: URL Rewrite for anchor link

Post 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
Post Reply

Return to “CMSMS Core”