Apache

  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteBase /
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteRule ^(.*)$ index.php?r=/$1 [QSA,PT,L]
  7. </IfModule>
RewriteRule ^(.*)$ index.php?r=/$1 [QSA,PT,L]规则中的?r= r是可配置的分隔符通过var_pathinfo=>'r'配置

原文: http://doc.cmlphp.com/devops/rewrite/apache.html