rewriterule(Discuz如何设置伪静态)
phrase structure rule是什么意思
phrasestructurerule:词组律;短语/片语结构规则例:Thecombinationalpatterninalinearformulamaybecalledaphrasestructuralrule,orrewriterule.短语结构规则是一组句法重写规则。相关词组:context-freestructure语境自由结构;不受语境限制的语言结构context-freephrasestructurerule语境自由词组律context-freegrammar语境自由语法
Discuz如何设置伪静态
1、登陆discuz网站后台,默认后台路径是:域名/admin.php
2、在discuz管理后台,点击上方导航栏的【全局】,进入全局设置
3、在全局设置里,点击左侧导航栏【SEO设置】
4、全部勾选URL静态化内容选项,完成后点击下方【提交】
5、登陆空间控制面板,打开【文件管理器】
6、点击【public_html】,进入空间根目录
7、进入根目录后,下拉至底部。在创建新文件处,输入“.htaccess”并点击创建
8、复制粘贴下面的discuz伪静态规则(注意不要对代码进行修改),完成后点击下方【另存为】
RewriteEngineOnRewriteBase/RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^topic-(.+)\.html$portal.php?mod=topic&topic=$1&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^article-([0-9]+)-([0-9]+)\.html$portal.php?mod=view&aid=$1&page=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^forum-(\w+)-([0-9]+)\.html$forum.php?mod=forumdisplay&fid=$1&page=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^group-([0-9]+)-([0-9]+)\.html$forum.php?mod=group&fid=$1&page=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^space-(username|uid)-(.+)\.html$home.php?mod=space&$1=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^blog-([0-9]+)-([0-9]+)\.html$home.php?mod=space&uid=$1&do=blog&id=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^archiver/(fid|tid)-([0-9]+)\.html$archiver/index.php?action=$1&value=$2&%1RewriteCond%{QUERY_STRING}^(.*)$RewriteRule^([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$plugin.php?id=$1:$2&%1
※全选上方代码复制粘贴(如下图)
完成以上内容,您的discuz网站伪静态就设置成功了。
Apache重定向url带参数应该如何写规则
RewriteEngineonRewriteRule^/test([0-9]*).html$/test.php?id=$1
RewriteRule^/new([0-9]*)/$/new.php?id=$1
$1就是参数