RewriteEngine on

# For some web hosts the next line has to be activated
# RewriteBase /
RewriteRule /?\.gitignore$ - [F,L]
RewriteRule /?\.htaccess$ - [F,L]
RewriteRule /?CHANGELOG\.md$ - [F,L]
RewriteRule /?composer\.json$ - [F,L]
RewriteRule /?composer\.lock$ - [F,L]
RewriteRule /?constant\.php$ - [F,L]
RewriteRule /?docker-compose\.yml$ - [F,L]
RewriteRule /?Dockerfile$ - [F,L]
RewriteRule /?README\.md$ - [F,L]

# Redirect HTTP to HTTPS if host is codelinered.net
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} codelinered\.net
RewriteRule ^(.*)$ https://pdf.codelinered.net/$1 [L,R=301]

# Forwards all requests to index.php, except files and folders
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [NC,L,QSA]