Themeforest item live preview issue

Hi,

My items live preview is not working with envato default frame. When I close the frame then the url is working well. How can I fix it? I talked with my hosting provider and they told me it’s fine with their end.

What should I do now? My item link is here: https://themeforest.net/item/ploye-online-gambling-and-casino-html-template/28390361

Thanks in advance!

Your website is returning the following header:

x-frame-options: SAMEORIGIN

This prevents Envato from being able to show your demo in a frame. I recommend checking out this existing thread where we went into more detail and offered a solution with an .htaccess file:

If you need any help with this, your web host is best suited for the task.

1 Like

Hi,

I created .htaccess file on my root directory. Can you please tell me what actually I should put or write on that file?

Thanks.

To only allow framing on ThemeForest:

<IfModule mod_headers.c>
	Header always append X-Frame-Options "ALLOW-FROM http://preview.themeforest.net/"
	Header always append Content-Security-Policy "frame-ancestors https://preview.themeforest.net/;"
</IfModule>

Or, to allow any website to embed your demos:

<IfModule mod_headers.c>
	Header always unset X-Frame-Options
</IfModule>

I applied these two methods exactly the same but nothing change.

I’m pretty sure .htaccess needs to go inside the document root, which on a cPanel server should be public_html. Try moving it to public_html/.htaccess.

I moved .htaccess file inside the public_html folder but still no luck :frowning:

Hmm. The only possible explanations I can think of are:

  1. Your server doesn’t have mod_headers enabled, or:
  2. Your server (or virtual host) doesn’t allow overrides (which is required for .htaccess to work).

I’m sadly not in a very good position to debug this for you. I would highly recommend contacting your web host and asking them to look into why the header rule isn’t being applied. Chances are, they’ll already know what the problem is because someone else had it before.

Now it solved. They(my hosting comapny) putted the text for only themeforest frame.
Here’s the text:

Header always append Content-Security-Policy "frame-ancestors https://preview.themeforest.net/;"
2 Likes