男孩的作品,我代发.可以自定义地址后缀.比如- http://www.123.com/viewthread.exe?tid=1
复制代码 这样的地址
首先是rewrite规则,如果是独立主机,打开conf/httpd.conf,找到原来添加的rewrite规则,在下面添加- RewriteRule ^(.*)/(admincp|ajax|announcement|attachment|blog|digest|eccredit|faq|forumdisplay|frame|index|invite|leftmenu|logging|magic|member|memcp|misc|modcp|my|plugin|pm|post|redirect|register|relatekw|relatethread|rss|search|seccode|space|stats|tag|topic|topicadmin|trade|viewpro|viewthread).html$ $1/$2.php
复制代码 用虚拟主机的在.htaccess文件中找到原来的规则,添加- RewriteRule ^(admincp|ajax|announcement|attachment|blog|digest|eccredit|faq|forumdisplay|frame|index|invite|leftmenu|logging|magic|member|memcp|misc|modcp|my|plugin|pm|post|redirect|register|relatekw|relatethread|rss|search|seccode|space|stats|tag|topic|topicadmin|trade|viewpro|viewthread).html$ $1.php
复制代码 原来的规则什么的请自己阅读: https://discuz.dismall.com/usersguide/advanced_urlrewrite.htm
你可以看到上面规则中 viewthread).html$, 你可以自己改 .html, 比如改成 .asp .css .exe 甚至去掉都行.
打开global.func.php
查找- $content = preg_replace($searcharray, $replacearray, ob_get_contents());
复制代码 注释掉,即改为- // $content = preg_replace($searcharray, $replacearray, ob_get_contents());
复制代码 并在其上面加- $rewriteext = '.html'; // 扩展名,要和你在rewrite规则中设定的一致
- $match = '/(=)+([\'|"])?('.preg_quote($boardurl, '/').')?(admincp|ajax|announcement|attachment|blog|digest|eccredit|faq|forumdisplay|frame|index|invite|leftmenu|logging|magic|member|memcp|misc|modcp|my|plugin|pm|post|redirect|register|relatekw|relatethread|rss|search|seccode|space|stats|tag|topic|topicadmin|trade|viewpro|viewthread)+(\.php)/i';
- $replace = '$1$2$3$4'.$rewriteext;
- $content = preg_replace($match, $replace, ob_get_contents());
复制代码 最后关键一步:
演示:
http://bbs.1001year.net/memcp.html
http://bbs.1001year.net/magic.html
http://bbs.1001year.net/forumdisplay.html?fid=48
http://bbs.1001year.net/viewthread.html?tid=83401
觉得是AD可不要点。.. |