Website URL
Error Message
I decided to add a basic login system to my site, just to test - and now my site crashes intermittently when I reload it with a forced cache reset. I have already tried disabling and enabling caching on the server and browser side - it didn’t help:
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
I also tried cache boosting CSS styles with:
<link rel="stylesheet" href="css/style.css?<?php echo substr(str_shuffle(md5(time())), 0, 10); ?>">
…but this made it even worse, and the site generally broke down completely much more often. Also, I tried enabling and disabling the PHP interpretation handler inside .html files via .htaccess:
AddType application/x-httpd-php .html
<FilesMatch "\.html$">
SetHandler application/x-httpd-php
</FilesMatch>
…and just changing the extension from html to PHP. However, this did not give results - everything remained exactly the same as it was.
This problem can be easily noticed if you go for example, in incognito mode (InPrivate) and refresh the page with a cache reset, or if, for example, the index.html or main.css file changes on the cached site. This will break all styles, and everything will be fixed only after 20 - 40 minutes, or even never at all.
This is how my website looks with “killed” styles:
And now how it SHOULD look like (ss from localhosted site on openserver):
Other Information
I already re-checked all of my code (include php) and it have no problems. Also i asked GPT-4 but it said that my code don’t have any errors (well, it’s ineffective, but it shouldn’t completly break my site).
Here’s my .htaccess file:
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
#<FilesMatch "\.(css|js)$">
#Header set Cache-Control "max-age=0, public"
#</FilesMatch>
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
# Remove ?i=1
RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^.]+)$ $1.html [NC,L]
RewriteCond %{THE_REQUEST} /index\.(html|php|htm)\s [NC]
RewriteRule ^(.*?)index\.(html|php|htm)$ /$1 [L,R=301,NC]
AddType application/x-httpd-php .html
<FilesMatch "\.html$">
SetHandler application/x-httpd-php
</FilesMatch>
ErrorDocument 403 https://classicpvp.ru/403
ErrorDocument 404 https://classicpvp.ru/404
ErrorDocument 405 https://classicpvp.ru/405
ErrorDocument 406 https://classicpvp.ru/406
ErrorDocument 500 https://classicpvp.ru/500