CMS Image preview not working an internal demo site
-
16-10-2019 - |
Question
I have a local demo website which is protected by a .htaccess
to showcase to the customer. Anyways, in this installation the image preview in the CMS WYSIWYG editor is not working.
In the system.log
there is an entry:
ERR (3): Warning: getimagesize(http://example.com/skin/adminhtml/default/ test/images/wysiwyg/skin_image.png): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /var/www/public/lib/Varien/Image/Adapter/Gd2.php on line 71
Solution
Magento makes HTTP access to fetch the included images from the webserver - even if it might be the same server.
The solution is to allow the local host to access itself without password. In Apache this would be:
Require valid-user Allow from 127.0.0.1 Satisfy Any
OTHER TIPS
Rewrite Mage_Adminhtml_Cms_WysiwygController
controller and replace the code below in the directiveAction
method:
$url = Mage::getModel('core/email_template_filter')->filter($directive);
with:
$url = str_replace(Mage::getBaseUrl('media'), Mage::getBaseDir('media') . DS, $url);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange