V13 Preview Not working - 404

Hi
Whether page is published or not, preview returns 404 - Page Not found.
Pages work when viewing in normal mode.

Any suggestions?

Actually I think its to do with iframe restriction recommended security measure.

Check if you have this (or similar)

app.UseXfo(options => options.Deny());

Comment that out and see if it works, did for me, but not ideal solution.

1 Like

You could use this instead of commenting that out, which is from the NwebSec library:

app.UseXfo(options => options.SameOrigin());

You can also use a custom middleware to set the header, without the NwebSec package if that’s all it’s being used for!

app.Use(async (context, next) =>
    {
        context.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
        await next();
    });