Options -Indexes

DirectoryIndex index.php

<IfModule mod_rewrite.c>

# =================================================
# ADMINISTRATOR CLEAN URL
# =================================================
RewriteRule ^administrator/?$ administrator/index.php [QSA,L]



RewriteEngine On
RewriteBase /app/

# =================================================
# ARCHIVOS REALES
# =================================================
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# =================================================
# MULTIEMPRESA DASHBOARD
# /companies/empresa
# =================================================
RewriteRule ^companies/([a-zA-Z0-9_-]+)/?$ companies/index.php?slug=$1 [QSA,L]

# =================================================
# MULTIEMPRESA MODULOS
# /companies/empresa/compras
# =================================================
RewriteRule ^companies/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ companies/index.php?slug=$1&module=$2 [QSA,L]

# =================================================
# URLS LIMPIAS PHP
# =================================================
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [QSA,L]

# =================================================
# OCULTAR .PHP
# =================================================
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
RewriteRule ^ %1 [R=301,L]

</IfModule>
