apache mod_rewrite problem: all css/js/images 404 |
(02-12-2021, 09:59 PM)InsiteFX Wrote: What does it tell you when you use the we browsers developer tools F12 ?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. |
Messages In This Thread |
apache mod_rewrite problem: all css/js/images 404 - by sneakyimp - 02-12-2021, 12:51 PM
RE: apache mod_rewrite problem: all css/js/images 404 - by kenjis - 02-12-2021, 07:02 PM
RE: apache mod_rewrite problem: all css/js/images 404 - by sneakyimp - 02-12-2021, 07:14 PM
RE: apache mod_rewrite problem: all css/js/images 404 - by InsiteFX - 02-12-2021, 09:59 PM
RE: apache mod_rewrite problem: all css/js/images 404 - by sneakyimp - 02-13-2021, 09:40 AM
|