I set up a staging site from the live site with my hosting, A2 Hosting. The pages are all messed up, and in the browser console, I could see lots of mime type errors (photo for examples). The errors come from CSS and JS files from all the plugins and theme.
I talked to hosting support, and they edited the .htaccess file to disable nosniff, so the browser can see what they really are. But now they are generating 404 Not Found errors in the Network tab of the browser developer tools. But if I copy one of the URLs from the error and put it in another browser tab, it comes right up, no problem.
This makes no sense to me, and I would appreciate a pointer how to fix it.
I set up a staging site from the live site with my hosting, A2 Hosting. The pages are all messed up, and in the browser console, I could see lots of mime type errors (photo for examples). The errors come from CSS and JS files from all the plugins and theme.
I talked to hosting support, and they edited the .htaccess file to disable nosniff, so the browser can see what they really are. But now they are generating 404 Not Found errors in the Network tab of the browser developer tools. But if I copy one of the URLs from the error and put it in another browser tab, it comes right up, no problem.
This makes no sense to me, and I would appreciate a pointer how to fix it.
Share Improve this question asked Oct 7, 2020 at 20:17 Jim WorrallJim Worrall 1777 bronze badges 2 |1 Answer
Reset to default 0I found there were two problems causing this:
There is some kind of server caching I apparently don't manage. I cleared that by adding a query to the URL (like staging.site/?a=b) and some things started being served, but many were still giving 404s.
There was a rewrite rule in .htaccess designed to prevent hotlinking things in wp-content, allowing google and my site only. That was not updated to the staging URL during creation of the staging. So the staging site was blocking itself!
Sorry, I know this kind of thing would be impossible for anyone to solve unless you had full access to the site and tons of time to devote to it. I appreciate people looking.
AddType text/css .css
andAddType application/javascript .js
. – Ivan Shatsky Commented Oct 7, 2020 at 21:47