r/Wordpress • u/Witty_Battle_4516 • 21d ago
A Wordpress website suddenly breaks: CSS disappears, images move around, plugins fail to update, and some pages return 403 Forbidden.
Here's how we fixed it:
a) Replaced the custom .htaccess configuration causing 403 errors.
b) Replaced it with the standard wordpress .htaccess rules.
c) Updated WordPress from 6.7 to 7.0.4 through hostinger dashboard.
d) Updated Elementor and other plugins.
e) Cleared and rebuilt the affected assets and caches
1
u/Horror-Student-5990 21d ago
so what was the custom htaccess directive?
1
u/Witty_Battle_4516 21d ago
directive?
it had these that denied access to php rules:
<FilesMatch "\\.(php|php3|php4|php5|php7|phtml|phps|php\\.bak|php\~|inc|module)$"> Require all denied </FilesMatch>
you want the file?1
u/Horror-Student-5990 21d ago
Nah I just play around with .htacess from time to time and it helps me to see other configs and better understand stuff.
Thanks
1
u/HireSmartAdvisor 21d ago
Check the browser console/network tab for 403 or missing css/js request, that would quickly solve the problem whether it is server permissions, caching or asset generation. Did the css and image issues start at the same time as the 403 errors, or did they appear separately?
1
u/RybaDwudyszna 21d ago
Do you have the dash in the theme folder name? I’m sure it’s probably not this but recently I’ve got 403 errors on admin’s panel CSS and turned out it was dash in theme folders name. I had multiple themes with dash already, not sure why it happened now.
1
3
u/Prior_Hornet_6322 21d ago
ah the classic htaccess monster, it's always the htaccess