除非特定文件存在于根目录中,否则我想将所有 URI 传递到 index.php 中。当谈到排除 index.php 时,我有点难过,因为它当然不符合我最后的全部规则
Options +FollowSymLinks -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} != "index/.php" // I'm not sure on the syntax here
RewriteRule ^(.*)$ $1.php [L]
RewriteRule ^([^/]*)(.*)$ index.php?category=$1&post=$2 [L,QSA]