技术文章
当前位置:首页 > 技术文章

.htaccess伪静态地址重写实例

.htaccess伪静态地址重写实例,部分URL重写规则参考如下:
 
RewriteEngine On
RewriteRule specials0-(\d+)\.aspx\?*(.*)$ specials\.aspx\?page=$1
RewriteRule searched-(\d+)-(\w+)\.aspx\?*(.*)$ searched\.aspx\?page=$1&key=$2
RewriteRule promotions0-(\d+)-(\w+)-(\w+)\.aspx\?*(.*)$ promotions\.aspx\?page=$1&orderby=$2&type=$3
RewriteRule promotions0-(\d+)\.aspx\?*(.*)$ promotions\.aspx\?page=$1
RewriteRule productpl(\d+)-(\d+)\.aspx\?*(.*)$ productpl\.aspx\?id=$1&page=$2
RewriteRule news(\d+)-(\d+)\.aspx\?*(.*)$ news\.aspx\?id=$1&page=$2
RewriteRule hot0-(\d+)-(\w+)-(\w+)\.aspx\?*(.*)$ hot\.aspx\?page=$1&orderby=$2&type=$3
RewriteRule hot0-(\d+)\.aspx\?*(.*)$ hot\.aspx\?page=$1
RewriteRule catalog(\d+)-(\d+)\.aspx\?*(.*)$ catalog\.aspx\?id=$1&page=$2
RewriteRule freeshipping0-(\d+)\.aspx\?*(.*)$ freeshipping\.aspx\?page=$1
RewriteRule catalog(\d+)-(\d+)\.aspx\?*(.*)$ catalog\.aspx\?id=$1&page=$2
RewriteRule cent0-(\d+)\.aspx\?*(.*)$ cent\.aspx\?page=$1
RewriteRule new(\d+)\.aspx\?*(.*)$ new\.aspx\?id=$1
RewriteRule news(\d+)\.aspx\?*(.*)$ news\.aspx\?id=$1
RewriteRule content(\d+)\.aspx\?*(.*)$ content\.aspx\?id=$1
RewriteRule article(\d+)\.aspx\?*(.*)$ article\.aspx\?id=$1
RewriteRule articles(\d+)\.aspx\?*$ articles\.aspx\?id=$1
RewriteRule help(\d+)\.aspx\?*(.*)$ help\.aspx\?id=$1
RewriteRule helps(\d+)\.aspx\?*(.*)$ helps\.aspx\?id=$1
 
以上实例在大部分虚拟主机上都可正常使用,如有特殊要求,请灵活修改。