Twitter share image


#1

I have a password protected inner page to share with twitter share button, but it is rendering my login page in the preview , not my desired page content. How to overcome this?


#2

Hi Nurun, our crawler cannot reach the protected page so I assume you are redirecting to the login page which then becomes the preview. I also assume the preview you are referring to is for a summary card, but please let me know if that’s not the case.

To overcome this you could allow non-authenticated access to the page if the user-agent is Twitterbot/1.0, but that has security issues. You could also check the user-agent before redirecting to the login page. If the request comes from Twitterbot/1.0, simply return a page with just meta tags for the card. If it’s not Twitterbot/1.0, then redirect to your login page as a user would expect. Let me know if that helps or if you have questions.


#3

#4