您现在的位置是:首页 > 其他

李清波 2014-05-16 其他 32441 复制当前网址

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

文章来源:http://liqingbo.com/blog-194.html

评论