IIS 伪静态
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" />
</rule>
<rule name="portal_article">
<match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_forumdisplay">
<match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="forum_viewthread">
<match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" />
</rule>
<rule name="group_group">
<match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" />
</rule>
<rule name="home_space">
<match url="^(.*/)*space-(username[-]uid)-(.+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" />
</rule>
<rule name="home_blog">
<match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" />
</rule>
<rule name="forum_archiver">
<match url="^(.*/)*(fid[-]tid)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" />
</rule>
<rule name="exx_typere">
<match url="^(.*/)*f([0-9]+)-t([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&filter=typeid&typeid={R:3}" />
</rule>
<rule name="exx_typere_page">
<match url="^(.*/)*f([0-9]+)-t([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&typeid={R:3}&filter=typeid&typeid={R:3}&page={R:4}" />
</rule>
<rule name="tag_id">
<match url="^(.*/)*tag-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&id={R:2}&{R:3}" />
</rule>
<rule name="tag_type">
<match url="^(.*/)*tag-([0-9]+)-(thread[-]blog).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&id={R:2}&type={R:3}&{R:4}" />
</rule>
<rule name="tag">
<match url="^(.*/)*tag.html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&{R:2}" />
</rule>
<rule name="f_gid">
<match url="^(.*/)*gid-([0-9]+)\.html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?gid={R:2}&{R:3}" />
</rule>
<rule name="f_index">
<match url="^(.*/)*forum\.html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php" />
</rule>
<rule name="plugin">
<match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" />
</rule>
配置文件;
<?xml version="1.0" encoding="gbk"?>
<configuration>
<system.webServer>
<!--start-php-->
<handlers>
</handlers>
<!--end-php-->
<!--start-rewrite-->
<rewrite>
<rules>
<rule name="portal_topic">
<match url="^(.*/)*topic-(.+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" ></action>
</rule>
<rule name="portal_article">
<match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/portal.php\?mod=view&aid={R:2}&page={R:3}&{R:4}" ></action>
</rule>
<rule name="forum_forumdisplay">
<match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}" ></action>
</rule>
<rule name="forum_viewthread">
<match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}" ></action>
</rule>
<rule name="group_group">
<match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?mod=group&fid={R:2}&page={R:3}&{R:4}" ></action>
</rule>
<rule name="home_space">
<match url="^(.*/)*space-(username[-]uid)-(.+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/home.php\?mod=space&{R:2}={R:3}&{R:4}" ></action>
</rule>
<rule name="home_blog">
<match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/home.php\?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}" ></action>
</rule>
<rule name="forum_archiver">
<match url="^(.*/)*(fid[-]tid)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" ></action>
</rule>
<rule name="exx_typere">
<match url="^(.*/)*f([0-9]+)-t([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&filter=typeid&typeid={R:3}" ></action>
</rule>
<rule name="exx_typere_page">
<match url="^(.*/)*f([0-9]+)-t([0-9]+)-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?mod=forumdisplay&fid={R:2}&typeid={R:3}&filter=typeid&typeid={R:3}&page={R:4}" ></action>
</rule>
<rule name="tag_id">
<match url="^(.*/)*tag-([0-9]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&id={R:2}&{R:3}" ></action>
</rule>
<rule name="tag_type">
<match url="^(.*/)*tag-([0-9]+)-(thread[-]blog).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&id={R:2}&type={R:3}&{R:4}" ></action>
</rule>
<rule name="tag">
<match url="^(.*/)*tag.html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/misc.php\?mod=tag&{R:2}" ></action>
</rule>
<rule name="f_gid">
<match url="^(.*/)*gid-([0-9]+)\.html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php\?gid={R:2}&{R:3}" ></action>
</rule>
<rule name="f_index">
<match url="^(.*/)*forum\.html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/forum.php" ></action>
</rule>
<rule name="plugin">
<match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)$" ></match>
<action type="Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" ></action>
</rule>
</rules>
</rewrite>
<httpErrors>
<remove statusCode="403" subStatusCode="-1" ></remove>
<remove statusCode="404" subStatusCode="-1" ></remove>
<error statusCode="404" prefixLanguageFilePath="" path="/404.htm" responseMode="ExecuteURL" ></error>
<error statusCode="403" prefixLanguageFilePath="" path="/403.html" responseMode="ExecuteURL" ></error>
</httpErrors>
<!--end-rewrite-->
</system.webServer>
</configuration>
97w 最终版本:
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^\.]*)/(fid|tid)-([0-9]+)\.html$ $1/index.php?action=$2&value=$3 last;
rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
return 404;
}
shop.97w.net
这个有点奇怪, 在 宝塔上, 大写的有的可以,有的不可以
rewrite ^/vip(.*) /shop/view.php?str=$1;
rewrite ^/(.*)/search(.*).html /$1/index.php?str=$2;
rewrite ^/(.*)/view([0-9]*).html /$1/view.php?id=$2;
rewrite ^/(.*)/(.*)list(.*).html /$1/$2list.php?str=$3;
rewrite ^/(.*)/(.*)view(.*).html /$1/$2view.php?id=$3;
多试试 这2个版本
RewriteEngine On
RewriteBase /
RewriteRule ^vip(.*) shop/view.php?str=$1
RewriteRule ^(.*)/search(.*).html $1/index.php?str=$2
RewriteRule ^(.*)/view([0-9]*).html $1/view.php?id=$2
RewriteRule ^(.*)/(.*)list(.*).html $1/$2list.php?str=$3
RewriteRule ^(.*)/(.*)view(.*).html $1/$2view.php?id=$3
用的php 是 5.6
7.4 的 在首页 会有一个小的提示。
欢迎来撩 : 汇总all