# .htaccess
#
# Project: Universal PHP MVC Boilerplate
# Author: Christo Lochenberg Developments
# Website: https://christodev.co.za
#
# SIMPLIFIED VERSION - For server compatibility

<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Set the base path for the rewrite engine
    # For http://boilerplate.local/ this should be "/"
    RewriteBase /

    # If the request is for a file that exists, serve it directly
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    # If the request is for a directory that exists, serve it directly
    RewriteCond %{REQUEST_FILENAME} -d
    # If either of the above is true, stop processing rules
    RewriteRule ^ - [L]

    # If the request is NOT for a real file or directory,
    # send it to index.php and pass the URL as a query string.
    RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]

</IfModule>