PHP7中文手册2018 带注释 最新chm版
-
Apache中的DiscuzX1.5二级域名配置
原帖:http://www.discuz.net/forum.php?mod=viewthread&tid=1879755
配置环境
------------------
操作系统:Win2003
Apache版本:2.2
MySQL版本:5.0
------------------在config文件夹下面修改config_global.php
// -------------------------- CONFIG COOKIE --------------------------- //
$_config['cookie']['cookiepre'] = '9aPs_';
$_config['cookie']['cookiedomain'] = '.discuzx.com';//注意此处
$_config['cookie']['cookiepath'] = '/';进入网站管理后台:
全局=>域名设置(左侧) ->基本设置 应用域名 根域名设置<-
点击"应用域名",填写如下
门户:www.discuzx.com
广场:bbs.discuzx.com
群组:group.discuzx.com
家园:home.discuzx.com
默认:discuzx.com
点击提交。
配置Apache中的httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:/www/DiscuzX"
ServerName DiscuzX.com
ServerAlias bbs.DiscuzX.com
</VirtualHost>
本地测试,修改hosts文件(C:\WINDOWS\system32\drivers\etc),需要测试都指向本地就可以了
----------------------------
127.0.0.1 DiscuzX.com
127.0.0.1 forum.DiscuzX.com
127.0.0.1 www.DiscuzX.com
127.0.0.1 bbs.DiscuzX.com
127.0.0.1 group.DiscuzX.com
127.0.0.1 home.DiscuzX.com127.0.0.1 music.bbs.DiscuzX.com
...
--------------------------设置频道的二级域名
全局=>域名设置(左侧) 点击“根域名设置”
频道:discuzx.com
一定要先设置“根域名”,二级绑定域名才会出现。
绑定域名: http://pindao1.discuzx.com 在设置完版块根域名后,这里的设置才有效广场的三级域名
广场:bbs.discuzx.com
绑定域名也和频道一样的填写就OK了,如果想设置成二级域名,修改广场目录为“根目录”即可
-----开启URL静态化------
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3&%1
-------------------支持泛解析的话如下:
<VirtualHost *:80>
DocumentRoot "D:/www/DiscuzX"
ServerName DiscuzX.com
ServerAlias *.DiscuzX.com
...
设置完毕。NOTE:
Notice: Undefined index: subarea in D:\www\DiscuzX\index.php on line 37
Notice: Undefined index: channel in D:\www\DiscuzX\index.php on line 371.PHP.ini配置文件:
error_reporting = E_ALL | E_STRICT
修改为
error_reporting = E_ALL & ~E_NOTICE2.
...源码修改....知道的留言呵呵。
---附带Discuz7.2的重写规则-------
<VirtualHost *:80>
DocumentRoot "D:/www/Discuz7"
ServerName discuz7.com
ServerAlias *.discuz7.comRewriteEngine On
RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
RewriteRule ^(.*)/tag-(.*)\.html$ $1/tag.php?name=$2
</VirtualHost>
转载请注明:谷谷点程序 » Apache中的DiscuzX1.5二级域名配置