External link not working | Community
Skip to main content
Level 3
March 28, 2023
Solved

External link not working

  • March 28, 2023
  • 2 replies
  • 1986 views

Hi!

I am trying to link an external link (link below) to a teaser component but it's not working. I validated the url with the linker checker as well and it's valid. If I remove the # after spa in the url it works. Not sure why 2 # in the url are causing issue? Please advise

 

https://experience.adobe.com/#/@abc/so:genera8/analytics/spa/#/workspace/edit/62bb42dc03db540279a7dbfe

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

Hello @reddyishanvi 

 

The second # in the URL https://experience.adobe.com/#/@abc/so:genera8/analytics/spa/#/workspace/edit/62bb42dc03db540279a7db is converted to %23 . It is because the # character is used in URLs to indicate an anchor or fragment identifier.

The fragment identifier is used to identify a specific section within a web page. When the browser encounters a # character in a URL, it treats the following characters as a fragment identifier and navigates to the specified section of the web page.

However, when a # character appears after the fragment identifier, it is no longer considered part of the fragment identifier but as a literal character. Therefore, to include a literal # character in a URL, it needs to be encoded as %23.

In the URL you provided, the second # character appears after the fragment identifier (#/workspace/edit/62bb42dc03db540279a7db), so it is encoded as %23 to be treated as a literal character rather than as part of the fragment identifier.



2 replies

DPrakashRaj
Community Advisor
Community Advisor
April 1, 2023

When I pasted the above link in browser I noticed that 2nd # is getting converted to %23. You need to check why this happened . Secondly you can skip the link validation on htl sightly using x-cq-linkchecker="valid" or skip.

Detail on http://www.wemblog.com/2011/10/how-to-make-sure-that-links-are-always.html?m=1

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
April 3, 2023

Hello @reddyishanvi 

 

The second # in the URL https://experience.adobe.com/#/@abc/so:genera8/analytics/spa/#/workspace/edit/62bb42dc03db540279a7db is converted to %23 . It is because the # character is used in URLs to indicate an anchor or fragment identifier.

The fragment identifier is used to identify a specific section within a web page. When the browser encounters a # character in a URL, it treats the following characters as a fragment identifier and navigates to the specified section of the web page.

However, when a # character appears after the fragment identifier, it is no longer considered part of the fragment identifier but as a literal character. Therefore, to include a literal # character in a URL, it needs to be encoded as %23.

In the URL you provided, the second # character appears after the fragment identifier (#/workspace/edit/62bb42dc03db540279a7db), so it is encoded as %23 to be treated as a literal character rather than as part of the fragment identifier.



Aanchal Sikka
Level 3
April 17, 2023

Thank you @aanchal-sikka