RewriteEngine On
RewriteRule ^([-a-zA-Z0-9]+)\.html$ /$1/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)\.html$ /$1/$2/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)\.html$ /$1/$2/$3/ [L]
RewriteRule !\.(js|ico|gif|bmp|jpg|png|css|xml|htm|txt)$ index.php [NC]

或者

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^([-a-zA-Z0-9]+)\.html$ /$1/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)\.html$ /$1/$2/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)\.html$ /$1/$2/$3/ [L]
RewriteRule ^.*$ /index.php [NC,L]

bootstrap.php中添加

 

posted on 2009-02-03 15:41  wkjs  阅读(235)  评论(0编辑  收藏  举报