Welcome Guest, Not a member yet? Register   Sign In
apache mod_rewrite problem: all css/js/images 404
#5

(02-12-2021, 09:59 PM)InsiteFX Wrote: What does it tell you when you use the we browsers developer tools F12 ?

It could be a CORS problem.
the domain requests are all consistent. Every asset reference in the HTML is a relative reference. Attempting to access an asset directly was leading to 404. I.e., I'd just type this in the browser url bar and get 404: https://www.example.com/js/bootstrap.js

To reiterate, the problem stems from the fact that I was putting my mod_rewrite rules in the apache conf rather than in the .htaccess file. In an .htaccess file, Apache knows what the local file system is. Apparently when these rules are evaluated in the apache conf, the local file system location has not yet been worked out by Apache so you must prepend %{DOCUMENT_ROOT} to %{REQUEST_FILENAME} for the main RewriteRule.
Reply


Messages In This Thread
RE: apache mod_rewrite problem: all css/js/images 404 - by sneakyimp - 02-13-2021, 09:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB