Live Preview fails to load Live preview is not working.  The following error appears in Inspect Element (Safari).  It then times out and generates a whole bunch of can't load errors. but this appears to the root of those subsequent errors.


  XMLHttpRequest cannot load http://www.mydomain.com/index.php?p=posts/2016/thisost. Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin.


I saw a related question that referred to the .htaccess file.  But I can't seem to find the.htaccess file. 

So, I guess this is an A and then B question.  The first (A) being the focus and B only of import if its related to the solution for A.

I hope that makes sense.  Thanks
A browser will give that error by default when you try make an AJAX call from domain A to domain B.

In your particular case, it looks like you're loading the control panel from mydomain.com, but the live preview request (which comes from how you defined your Site URL under Settings->General) has www.mydomain.com in it.

Note the www.  A browser will treat that as an entirely separate domain.

If that's how you want it, great.  You need to modify your public .htaccess file (the one that sits next to Craft's public index.php file to allow the other domain via Access-Control-Allow-Origin.

Likely it's just a mistake though and you should correct the Site URL setting or access the control panel from the other domain.

It's also worth forcing one or the other (www redirect to non, or non redirect to www) via .htaccess for consistency and because search engines will treat them as one site.