# ZitiNexus Router Enrollment UI - Apache Configuration # This file helps serve assets correctly when document root is not set to /public/ RewriteEngine On # Serve assets directly from assets directory (highest priority) RewriteRule ^assets/(.*)$ assets/$1 [L] # Serve root-level PHP files directly (for current setup) RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(index|dashboard)\.php$ $1.php [L] # Fallback: redirect to public directory only if file doesn't exist in root RewriteRule ^$ index.php [L] # Handle other requests only if file doesn't exist in root RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/assets/ RewriteRule ^(.*)$ public/$1 [L] # Security: Deny access to sensitive directories Require all granted Require all denied Require all denied Require all denied # Set proper MIME types for assets AddType text/css .css AddType application/javascript .js AddType image/png .png AddType image/jpeg .jpg .jpeg AddType image/gif .gif AddType image/svg+xml .svg AddType image/x-icon .ico # Enable compression for text files AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript # Set cache headers for static assets ExpiresActive On ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year"