apache 伪静态htaccess规则

apache 伪静态htaccess规则

<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteLog "rewrite.log"
#public目录,sys目录…,不进行重写
RewriteCond %{REQUEST_URI} !^(/public(.*)|/sys(.*))$
#这些后缀的文件,不进行RewriteRule
RewriteCond %{REQUEST_URI} !^.*(/.css|/.js|/.gif|/.png|/.jpg|/.jpeg|/.bmp)$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule /index.html$ index.php/$1 [QSA,PT,L]

RewriteRule /news/aid-([0-9]+) /news/show/aid/$1

未经允许不得转载:淘淘源码吧 » apache 伪静态htaccess规则