Reputation: 51
I have created a post on my websites when I shared on LinkedIn, it's not showing complete URL of sharing.
Currently, I am using https://www.linkedin.com/sharing/share-offsite/?url=www.example.com/share/?id=12654
But When I am sharing with LinkedIn using above its redirect to below URL :
www.example.com/share
Its removing parameter which passed using id. How I can get the full URL: www.example.com/share/?id=12654
Upvotes: 5
Views: 5031
Reputation: 20946
Don't forget to do URL-encoding with parameters you are feeding to another URL. So, your link should be ...&url=https%3A%2F%2Fw...
, and not ...&url=https://
. Your URL also contains a question mark that should be escaped. Ultimately, your URL should look like this..
https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.example.com/share/%3Fid=12654
URL encoding is required any time you are sending a URL as an argument to the GET param of another URL.
In case you want to know more: Official LinkedIn Share Documentation
If you are interested in a regularly maintained GitHub project that keeps track of this so you don't have to, check it out! Social Share URLs
Upvotes: 1