# .htaccess dla React App - OSTATECZNA NAPRAWA EOF

# Ustaw index.html jako domyślną stronę
DirectoryIndex index.html

# Włącz moduł rewrite
<IfModule mod_rewrite.c>
  RewriteEngine On
  
  # Jeśli to jest żądanie do pliku lub folderu który istnieje, obsłuż normalnie
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]
  
  # Wszystkie inne żądania przekieruj do index.html (React Router)
  RewriteRule ^ index.html [L]
</IfModule>

# MIME types dla React
<IfModule mod_mime.c>
  AddType application/javascript .js
  AddType text/css .css
  AddType application/json .json
</IfModule>

# WYŁĄCZ WSZYSTKIE HANDLERY DLA .html
# To może powodować dodawanie EOF!
<Files "*.html">
  RemoveHandler .html
  ForceType text/html
</Files>

# PHP tylko dla .php files (NIE dla wszystkich!)
<Files "*.php">
  AddHandler application/x-httpd-php80 .php
</Files>