Fix for 'Unable to render Card preview' (Twitter SSL problem)
May 17th 2016
Learn how to fix the 'Unable to render Card preview' error and make your Twitter posts display images.
This error appears on websites using https, the issue that comes along with this error is that your Twitter posts don't show images.
Note: This fix is for apache servers , it will work on VPS or Dedicated hosting servers (you won't be able to make it work on shared hosting servers because you don't have access to the files that you need to update - contact your hosting company).
'Unable to render Card preview' Fix
There are a couple of steps that you need to take in order to fix this problem.
Firstly, you need to set the
ServerName in the
sudo nano /etc/apache2/apache2.conf
For demonstration purposes, I will use
example.com as the domain that encounters this error (you should use your domain name).
At the end of the config file, add the following line:
After this, go inside the
sites-enabled directory and open the file called
sudo nano /etc/apache2/sites-enabled/default-ssl.conf
Look for the
<VirtualHost *:80> (or
<VirtualHost _default_:443>) section.
ServerName (again) and the
ServerAlias like in the following snippet:
<VirtualHost _default_:443> ServerName example.com ServerAlias www.example.com </VirtualHost>
Now restart the server:
sudo service apache2 restart
Go to the Twitter debug tool and test one of your pages. You should see that the 'Unable to render Card preview' error is now gone.
Note: Twitter will slowly take care of the posted tweets by itself (your previous Twitter posts will be updated with the attached images).
That's it! I hope you found this tutorial useful!