localhost link not valid for social sites sharing | Community
Skip to main content
Level 4
August 12, 2022
Solved

localhost link not valid for social sites sharing

  • August 12, 2022
  • 3 replies
  • 1596 views

I have created a component for sharing the page on social sites like facebook, twitter, linkedin and whatsapp. This work is done AEM as a Cloud Service. But there is a problem with localhost link. The sharing window opens up but it says "href is not valid". When I googled it, it says that localhost link doesn't work for sharing on social media. Is there any alternate solution for this by which I can test my component  locally whether it works fine or not?

Best answer by arunpatidar

Hi,

You can try testing using dispatcher and map localhost to some dummy domain e.g. 

https://dreamithost.com.au/how-to-change-localhost-file-on-mac 

 

If you want to test just to prove it is working then use your existing domain or pages, the reason is social media may not be able to connect to your local system to fetch and show content.

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
August 12, 2022

Hi,

You can try testing using dispatcher and map localhost to some dummy domain e.g. 

https://dreamithost.com.au/how-to-change-localhost-file-on-mac 

 

If you want to test just to prove it is working then use your existing domain or pages, the reason is social media may not be able to connect to your local system to fetch and show content.

Arun Patidar
Level 2
August 14, 2022

You can use Nginx to generate public URL for your local host and test your component.

I did the same for HID testing.

January 4, 2025

Hi @nikita24tailor,

localhost links aren't valid for social sharing as platforms require public URLs. You can use tools like ngrok to create a temporary public link for testing.

Also, if you're testing sharing features for WhatsApp, tools like FM WhatsApp can offer advanced customization options for better functionality.

Hope this helps!