| 1 | <IfModule mod_rewrite.c> |
| 2 | RewriteEngine On |
| 3 | |
| 4 | # Remove .php from URLs (optional, depends on your setup) |
| 5 | # RewriteCond %{REQUEST_FILENAME} !-f |
| 6 | # RewriteCond %{REQUEST_FILENAME} !-d |
| 7 | # RewriteRule ^(.*)\.php$ $1 [L,R=301] |
| 8 | |
| 9 | # Route all requests to index.php except for actual files and directories |
| 10 | RewriteCond %{REQUEST_FILENAME} !-f |
| 11 | RewriteCond %{REQUEST_FILENAME} !-d |
| 12 | RewriteRule ^(.*)$ index.php [QSA,L] |
| 13 | </IfModule> |