Để loại bỏ “index.php” trong đường dẫn truy cập website ta tạo file .htaccess với nội dung sau:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,QSA] </IfModule> <IfModule !mod_rewrite.c> # Without mod_rewrite, route 404's to the front controller ErrorDocument 404 /index.php </IfModule> |
nosomovo