这是我使用的(并且已经使用了很长时间):
<IfModule mod_rewrite.c> # Redirect /index.php to / (optional, but recommended I guess) RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*index.php RewriteRule ^index.php/?(.*)$ $1 [R=301,L] # Run everything else but real files through index.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]</IfModule>正如评论所建议的那样,它将把不是实际文件的每个请求都路由到index.php



