raksmart活动促销

分享

写回答

发帖

关于LP的404错误页面和DZ的静态页面

国外虚拟主机 国外虚拟主机 4220 人阅读 | 17 人回复

发表于 2008-3-26 12:13:25 | 显示全部楼层 |阅读模式

我在pannel自定义了404错误页面,发现只有主域名的根目录下的404错误页面才能替换成自定义的,而其他目录如bbs,attachment目录下的都还是默认的404错误页面??怎么办??难道要把生成的自定义错误页面挨个放到每个目录下??

还有一个很郁闷的问题就是我启用了DZ的静态页面(像IDCspy这样的)后,发现生成的那些静态链接全都打不开,都是404错误……怎么办呢。。。

回答|共 17 个

bingu

发表于 2008-3-26 12:26:05 | 显示全部楼层

静态页面看一下有没有生成.htaccess
RAKSmart

tomalan68888

发表于 2008-3-26 12:26:15 | 显示全部楼层

顶~~

notcry

发表于 2008-3-26 12:59:29 | 显示全部楼层

建立一个.htaccess文件  放入Discuz!所在的目录

文件内容包括:
# 将 RewriteEngine 模式打开
RewriteEngine On

# 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 /
RewriteBase /discuz

# Rewrite 系统规则请勿修改
RewriteRule ^archiver/((fid|tid)-[\w\-]+\.html)$ archiver/index.php?$1
RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
RewriteRule ^tag-(.+)\.html$ tag.php?name=$1


其中“ RewriteBase /discuz”  为discuz!真正所在的目录,例如/bbs

之后在打开Discuz!后台里边的静态页面试试看
RAKSmart

tomalan68888

发表于 2008-3-26 13:14:15 | 显示全部楼层

按照楼上的方法编写了.htaccess文件放到了论坛目录,但是似乎不起作用,依然是404错误
我的php版本是PHP v5.2.5

忧伤b小调

发表于 2008-3-26 14:03:06 | 显示全部楼层

如方便,提供FTP帐号信息,我给你检查一下.

tomalan68888

发表于 2008-3-26 14:17:22 | 显示全部楼层

官方回答啦
Hello,

Because we use suPHP to parse php files, you have the option of using a custom php.ini file. Mod Rewrite can be enabled in the php,ini by mod_rewrite = on

Your account can have multiple php.ini files on your account in different folders so you can customize the php processing in different folders should your script require it. A php.ini file will not inherit down into subfolders, however, you can create a .htaccess file in the same folder as the php.ini file and place the following code into it:

suPHP_ConfigPath /home/username/public_html/

where "username" is your cPanel username. This will cause the php.ini file to affect all subfolders, unless a php.ini file is in a subfolder, at which point the php.ini in the subfolder takes precedence.

In php.ini, you will need to use the actual php.ini syntax instead of the php_value or php_flag syntax you would normally use in .htaccess (Which should not be used at all):

setting_name = setting_value

So, this means if you move the settings from .htaccess to php.ini, you must convert the format. Let's say you have the following line in your .htaccess file:

php_value register_globals 0

the corresponding php.ini format is as follows:

register_globals = Off

Notice how the value 0 becomes Off and 1 becomes On. Now if your php_value has quotes like the following, for example:

php_value include_path ".:/home/user/lib"

The corresponding php.ini format is:

include_path = ".:/home/user/lib"

and so on. You should only use the settings you need to change in your php.ini.

For the PHP settings you do not have in your php.ini file, PHP will use our default configurations.

--
Best Regards,

Benjamin Irby

忧伤b小调

发表于 2008-3-26 14:21:19 | 显示全部楼层

他们说他们是用suphp来解析PHP文件的,这样你就可以定义PHP.IN 文件...

然后是教你怎么使用PHP .IN文件...

--

tomalan68888

发表于 2008-3-26 14:22:25 | 显示全部楼层

但是覺得看著云里霧里的。。
有沒有好心人能說的通俗一點...

tomalan68888

发表于 2008-3-26 14:23:02 | 显示全部楼层

他還提到了 .htaccess 的設置
您需要登录后才可以回帖 登录 | 注册

本版积分规则