<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> if (in_array('portal_list', $_G['setting']['rewritestatus'])) {</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['search']['portal_list'] = "/" . $_G['domain']['pregxprw']['portal'] . "\?mod\=list&(amp;)?catid\=(\d+)(&page\=(\d+))?\"([^\>]*)\>/e";</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['replace']['portal_list'] = "rewriteoutput('portal_list', 0, '\\1', '\\3', '\\5', '\\6')";</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> }</span> |
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['rulesearch']['portal_list'] = 'list-{catid}-{page}.html';</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['rulereplace']['portal_list'] = 'portal.php?mod=list&catid={catid}&page={page}';</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['rulevars']['portal_list']['{catid}'] = '([0-9]+)';</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $data['rulevars']['portal_list']['{page}'] = '([0-9]+)';</span> |
<span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;">elseif ($type == 'portal_list') {</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> list(,,, $id, $page, $extra) = func_get_args();</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> $r = array(</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> '{catid}' => $id,</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> '{page}' => $page ? $page : 1,</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> );</span> <span style="font-family: Tahoma, 'Microsoft Yahei', Simsun;"> }</span> |
# Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=list&catid=$2&page=$3&$5 RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4 RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5 RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5 RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6 RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5 RewriteRule ^(.*)/space-(username|uid)-(.+)\.html(\?(.*))*$ $1/home\.php\?mod=space&$2=$3&$5 RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5 RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5 RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html(\?(.*))*$ $1/plugin\.php\?id=$2:$3&$5 復(fù)制代碼 IIS7偽靜態(tài)規(guī)則 <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="portal_topic"> <match url="^(.*/)*topic-(.+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <action type="Rewrite" url="{R:1}/portal.php\?mod=topic&topic={R:2}&{R:3}" /> </rule> <rule name="portal_list"> <match url="^(.*/)*list-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <action type="Rewrite" url="{R:1}/portal.php\?mod=list&catid={R:2}&page={R:3}&{R:4}" /> </rule> <rule name="portal_article"> <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <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\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <action type="Rewrite" url="{R:1}/index.php\?action={R:2}&value={R:3}&{R:4}" /> </rule> <rule name="plugin"> <match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)[ DISCUZ_CODE_2 ]quot; /> <action type="Rewrite" url="{R:1}/plugin.php\?id={R:2}:{R:3}&{R:4}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> |
# Rewrite 系統(tǒng)規(guī)則請(qǐng)勿修改 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^list-([0-9]+)-([0-9]+)\.html$ portal.php?mod=list&catid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ plugin.php?id=$1:$2&%1 |
rewrite ^([^\.]*)/list-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=list&catid=$2&page=$3 last; rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topicid=$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; } |
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: Discuz門戶文章列表頁(yè)偽靜態(tài)設(shè)置教程