RewriteEngine on

# For some web hosts the next line has to be activated
RewriteBase /
RewriteRule /?\.htaccess$ - [F,L]

# Redirect HTTP to HTTPS if host is codelinered.net
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} codelinered\.net
RewriteRule ^(.*)$ https://pi.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]