DirectoryIndex index.php
Options -Indexes

ErrorDocument 404 /404.php

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    RewriteCond %{HTTP_HOST} ^www\.hapitron\.co\.il$ [NC]
    RewriteRule ^ https://hapitron.co.il%{REQUEST_URI} [L,R=301]

    RewriteRule ^(merge-pdf|split-pdf|compress-pdf|edit-pdf|sign-pdf|scientific-calculator|convert-to-pdf|convert-from-pdf|rotate-pdf|delete-pdf-pages|extract-pdf-pages|reorder-pdf-pages|repeated-pdf-questions)/$ /$1 [R=301,L]

    RewriteRule ^student-benefits/?$ student-benefits.php [L]
    RewriteRule ^unlock-pdf/?$ index.php?tool=unlock_pdf [L,QSA]
    RewriteRule ^merge-pdf$ index.php?tool=merge [L,QSA]
    RewriteRule ^split-pdf$ index.php?tool=split [L,QSA]
    RewriteRule ^compress-pdf$ index.php?tool=compress [L,QSA]
    RewriteRule ^edit-pdf$ index.php?tool=edit [L,QSA]
    RewriteRule ^sign-pdf$ index.php?tool=sign [L,QSA]
    RewriteRule ^scientific-calculator$ index.php?tool=calculator [L,QSA]
    RewriteRule ^convert-to-pdf$ index.php?tool=convert_to_pdf [L,QSA]
    RewriteRule ^convert-from-pdf$ index.php?tool=convert_from_pdf [L,QSA]
    RewriteRule ^rotate-pdf$ index.php?tool=rotate_pdf [L,QSA]
    RewriteRule ^delete-pdf-pages$ index.php?tool=delete_pdf_pages [L,QSA]
    RewriteRule ^extract-pdf-pages$ index.php?tool=extract_pdf_pages [L,QSA]
    RewriteRule ^reorder-pdf-pages$ index.php?tool=reorder_pdf_pages [L,QSA]
    RewriteRule ^repeated-pdf-questions$ index.php?tool=repeated_pdf_questions [L,QSA]
</IfModule>

<IfModule mod_mime.c>
    AddType image/svg+xml .svg .svgz
    AddType application/manifest+json .webmanifest
    AddType application/wasm .wasm
    AddType application/gzip .gz
    AddType application/javascript .js .mjs
    AddEncoding gzip .svgz
</IfModule>

<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=()"

<FilesMatch "\.(ico|svg|svgz|png|jpg|jpeg|webp|gif|css|js|mjs|ttf|woff|woff2|wasm|gz)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>

    <FilesMatch "\.(html|php|json|webmanifest|xml|txt)$">
        Header set Cache-Control "no-cache"
    </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/javascript application/javascript application/json application/manifest+json image/svg+xml
</IfModule>