We are facing issue while authoring the content i.e anchors in the rich text. After authoring and publishing the page, the hrefs are showing the path of urls containing /content/<company-name>/.... while hovering on the links. For example, please see the below screenshot.
In this example, after hovering on the custom, the url contains the path having /content/<company-name>/usa/.....
But it should be www.<company-name>.com/usa-en/.
After clicking on the link, it is redirecting properly.
Can anyone help us to get it resolved?
As Scott mentioned, use Externalizing URLs to rewrite the urls for publish servers per your use case. You would have to write code/configurations to make it happen.
Today, if they work after clicking then that must be because of rewrite/redirect rules configured in /etc/map/http or apache. You would need to configure it on publish so that the cached content contains the updated urls per your requirement.
The first hyperlink i.e url for standard is working as expected hence I feel we shouldn't be using externalizer. We are facing this issue only for RTE components having hyperlink and not with any other call to action components. Please find the below screenshot for DOM of this content.
<p><a href="https://forums.adobe.com/content/<company-name>/<country>/<language>/pages/products/antennas/standard-antennas.html">Standard</a>, <a href="https://forums.adobe.com/content/<company-name>/<country>/<language>/products/antennas/custom-antennas.html">Custom</a></p>
It seems that you guys are already using either OOB externalizer or Link Checker Transformer or custom url-rewriting utility because the same content is exposed by /content/<company>/<country>/</language>/page1.html and /content/<company>/<country>-</language>/page1.html which happens only at publish server (if not at apache) for entire site. I noticed that the cached content has updated urls.
Now the issue happens with RTE only because it doesn't fall under the project's code boundaries as it is available OOB. When you add CTA's, your project code takes care of rewriting the urls from /<country>/</language> to /<country>-</language>.
One of the solutions would be to customize OOB RTE and enforce the url conversion in that or use a custom Transformer to rewrite specific <a:hrefs> of your project based on requirements & feasibility.