求牛逼的高手帮我实现iis7/8重写

亦可塞艇 发布于 2013/12/09 22:11
阅读 137
收藏 0
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/admin/?$ [NC]
RewriteRule ^(.*) /index.php?m=admin&c=admin&a=main [L,R=301]
 

RewriteRule ^news/$ /index.php?m=home&c=news&a=index [L]
RewriteRule ^news/list-(.*).html$ /index.php?m=home&c=news&a=index&q=$1 [L]
RewriteRule ^news/detail-(.*).html$ /index.php?m=home&c=news&a=detail&id=$1 [L]

RewriteRule ^notice/$ /index.php?m=home&c=notice&a=index [L]
RewriteRule ^notice/list-(.*).html$ /index.php?m=home&c=notice&a=index&q=$1 [L]
RewriteRule ^notice/detail-(.*).html$ /index.php?m=home&c=notice&a=detail&id=$1 [L]



RewriteRule ^product/list-(.*).html$ /index.php?m=home&c=product&a=index&q=$1 [L]
RewriteRule ^product/$ /index.php?m=home&c=product&a=index [L]
RewriteRule ^product/detail-(.*).html$ /index.php?m=home&c=product&a=detail&id=$1 [L]


RewriteRule ^pic/$ /index.php?m=home&c=pic&a=index [L]
RewriteRule ^pic/list-(.*).html$ /index.php?m=home&c=pic&a=index&q=$1 [L]
RewriteRule ^pic/detail-(.*).html$ /index.php?m=home&c=pic&a=detail&id=$1 [L]


RewriteRule ^about/detail-(.*).html$ /index.php?m=home&c=about&a=index&id=$1 [L]
RewriteRule ^about/ /index.php?m=home&c=about&a=index [L]
RewriteRule ^web/ /index.php?m=home&c=web&a=index [L]
RewriteRule ^404.html$ /index.php?m=home&c=error&a=_404 [L]
ErrorDocument  404 /404.html

加载中
返回顶部
顶部