<Files ~ "\.inc$">
  Order allow,deny
  Deny from all
</Files>

<files .htaccess>
order allow,deny
deny from all
</files>

<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>

Options -Indexes -MultiViews +FollowSymLinks
RewriteEngine On

ErrorDocument 404 /404.php
ErrorDocument 403 /403.php
ErrorDocument 500 /500.php

RewriteRule ^$ /index [L]

RedirectMatch 301 ^/kp_admin/(.*)$ http://secadmin.kkplending.test/$1
RedirectMatch 301 ^/kp_collector/(.*)$ http://collector.kkplending.test/$1
RedirectMatch 301 ^/kp_funder/(.*)$ http://funder.kkplending.test/$1
RewriteRule ^ref/(.*)$ ref.php?username=$1  [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^.]+)$ $1.php [NC,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.+)\.php - [F,L]