{* <?php die('duotaopu');?> *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>伪静态规则</title>
<style type="text/css">
body { font-family:Tahoma; margin:0}
.main{ padding:10px;}
p{ border-top:2px solid #CCC; background-color:#F9F9F9; padding:15px; font-size:18px; font-weight:bold; margin:0;}
pre{ line-height:100%;font-size:12px;border-bottom:2px solid #CCC; background-color:#F9F9F9;padding:0 20px 0 35px; margin-top:0;}
</style>
</head>
<body>
<div class="main" style="margin-top:20px;">
<strong>以下为4种常用主机规则，使用方法请咨询您的主机商</strong></div>
<div class="main">

<p>IIS6 Web Server(httpd.ini)</p>
<pre>
[ISAPI_Rewrite]
RepeatLimit 32
RewriteRule ^/{$rewrite_channel}/([0-9]+)\.{$rewrite_suffix}$ /index.php\?m=cate&a=shop&cid=$1
RewriteRule ^/{$rewrite_channel}/([0-9]+)-([0-9]+)\.{$rewrite_suffix}$ /index.php\?m=cate&a=shop&cid=$1&p=$2
RewriteRule ^/{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)\.{$rewrite_suffix}$ /index.php\?m=cate&a=shop&cid=$1&order=$2
RewriteRule ^/{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)-([0-9]+)\.{$rewrite_suffix}$ /index.php\?m=cate&a=shop&cid=$1&order=$2&p=$3
RewriteRule ^/{$rewrite_view}/([0-9]+)\.{$rewrite_suffix}$ /index.php\?m=view&a=gonggao&aid=$1

</pre>

<p>Apache Web Server(.htaccess)</p>
<pre>
RewriteEngine On
RewriteBase /
RewriteRule ^{$rewrite_channel}/([0-9]+)\.{$rewrite_suffix}$ index.php?m=cate&a=shop&cid=$1
RewriteRule ^{$rewrite_channel}/([0-9]+)-([0-9]+)\.{$rewrite_suffix}$ index.php?m=cate&a=shop&cid=$1&p=$2
RewriteRule ^{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)\.{$rewrite_suffix}$ index.php?m=cate&a=shop&cid=$1&order=$2
RewriteRule ^{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)-([0-9]+)\.{$rewrite_suffix}$ index.php?m=cate&a=shop&cid=$1&order=$2&p=$3
RewriteRule ^{$rewrite_view}/([0-9]+)\.{$rewrite_suffix}$ index.php?m=view&a=gonggao&aid=$1

</pre>

<p>IIS7/7.5 Web Server(web.config)</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration&gt;
    &lt;system.webServer&gt;
	&lt;rewrite&gt;
	   &lt;rules&gt;
		  &lt;rule name="vivi_d1"&gt;
			 &lt;match url="^{$rewrite_channel}/([0-9]+)\.{$rewrite_suffix}$" /&gt;
			 &lt;action type="Rewrite" url="index.php?m=cate&amp;amp;a=shop&amp;amp;cid={literal}{R:1}{/literal}" /&gt;
		  &lt;/rule&gt;
		  &lt;rule name="vivi_d2"&gt;
			 &lt;match url="^{$rewrite_channel}/([0-9]+)-([0-9]+)\.{$rewrite_suffix}$" /&gt;
			 &lt;action type="Rewrite" url="index.php?m=cate&amp;amp;a=shop&amp;amp;cid={literal}{R:1}{/literal}&amp;amp;p={literal}{R:2}{/literal}" /&gt;
		  &lt;/rule&gt;
		  &lt;rule name="vivi_d3"&gt;
			 &lt;match url="^{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)\.{$rewrite_suffix}$" /&gt;
			 &lt;action type="Rewrite" url="index.php?m=cate&amp;amp;a=shop&amp;amp;cid={literal}{R:1}{/literal}&amp;amp;order={literal}{R:2}{/literal}" /&gt;
		  &lt;/rule&gt;
		  &lt;rule name="vivi_d4"&gt;
			 &lt;match url="^{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)-([0-9]+)\.{$rewrite_suffix}$" /&gt;
			 &lt;action type="Rewrite" url="index.php?m=cate&amp;amp;a=shop&amp;amp;cid={literal}{R:1}{/literal}&amp;amp;order={literal}{R:2}{/literal}&amp;amp;p={literal}{R:3}{/literal}" /&gt;
		  &lt;/rule&gt;
		  &lt;rule name="vivi_d5"&gt;
			 &lt;match url="^{$rewrite_view}/([0-9]+)\.{$rewrite_suffix}$" /&gt;
			 &lt;action type="Rewrite" url="index.php?m=view&amp;a=gonggao&amp;amp;aid={literal}{R:1}{/literal}" /&gt;
		  &lt;/rule&gt;
	   &lt;/rules&gt;
	&lt;/rewrite&gt;
    &lt;/system.webServer&gt;
&lt;/configuration&gt;

</pre>

<p>Nginx Web Server(nginx.conf)</p>
<pre>
rewrite ^/{$rewrite_channel}/([0-9]+)\.{$rewrite_suffix}$ /index.php?m=cate&a=shop&cid=$1 last;
rewrite ^/{$rewrite_channel}/([0-9]+)-([0-9]+)\.{$rewrite_suffix}$ /index.php?m=cate&a=shop&cid=$1&p=$2 last;
rewrite ^/{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)\.{$rewrite_suffix}$ /index.php?m=cate&a=shop&cid=$1&order=$2 last;
rewrite ^/{$rewrite_channel}/([0-9]+)-order-([a-z,A-Z]+)-([0-9]+)\.{$rewrite_suffix}$ /index.php?m=cate&a=shop&cid=$1&order=$2&p=$3 last;
rewrite ^/{$rewrite_view}/([0-9]+)\.{$rewrite_suffix}$ /index.php?m=view&a=gonggao&aid=$1 last;

</pre>
</div>
<p></p>
</body>
</html>