Skip to main content
Level 4
Aug 12, 2022 5:57 AM UTC
Solved

localhost link not valid for social sites sharing

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?

arunpatidar
arunpatidarAccepted solution
Community Advisor
Aug 12, 2022 7:53 AM UTC

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

3 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
Aug 12, 2022 7:53 AM UTC

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.

Translate
Arun Patidar
Level 2
Aug 14, 2022 9:16 AM UTC

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

I did the same for HID testing.

Translate
Jan 4, 2025 7:40 AM UTC

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!

Translate