RewriteEngine on RewriteBase / #如果不是目录,才会执行下一条RewriteRule RewriteCond %{REQUEST_FILENAME} !-d #如果不是文件,才会执行下一条RewriteRule RewriteCond %{REQUEST_FILENAME} !-f #判断url是否以斜杠“/”结尾; RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ $1/ [L,R=301] RewriteRule ([\x80-\xffa-zA-Z]{1,})-([0-9]{1,})-([a-zA-Z]{1,}).html$ test.php?action=$1&id=$2&ac=$3 #RewriteRule ^about(/?)$ ?ac=about RewriteRule ^about(/?)$ ?ac=about RewriteRule ^histroy(/?)$ ?ac=histroy