Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] 404页面死活设置不成功

[复制链接]
魔剑烈皇 发表于 2013-7-29 10:56:56 | 显示全部楼层 |阅读模式

  PS:使用的是VPS,自己配置的apache+PHP+mysql+zend环境,伪静态正常,301跳转正常,网站访问一切正常。

  先说下我的两种设置(两种设置是分开的,一种不行了设置另一种):

  首先在httpd.conf里把#ErrorDocument 404 /404.html前面的#去掉了,AllowOverride All这个也改成“all”了。

  第一种设置:在.htaccess里添加ErrorDocument 404 /404.html

  并把404.html放网站根目录,重启apache服务,结果打开错误地址,浏览器提示:404 Page Not Found The page you requested was not found.无法跳转到404.html页面;(无论什么浏览器都提示这个)

  第二种设置:在虚拟主机配置文件httpd-vhosts.conf里添加:ErrorDocument 404 /404.html 具体如下:

  ServerAdmin webmaster@baidu.com

  DocumentRoot "D:/htdocs/baidu"

  ServerName www.baidu.com

  ErrorDocument 404 /404.html

  ErrorLog "logs/baidu.com-error.log"

  CustomLog "logs/baidu-access.log" common

  Options Indexes FollowSymLinks

  AllowOverride All

  Order allow,deny

  Allow from all

   网站的目录是D:/htdocs/baidu

       重启apache后,打开错误地址,依然提示:404 Page Not Found The page you requested was notfound.无法跳转到404.html页面。

  难道是我的路径设置错误吗?还是我的配置根本就是错误的?请懂得朋友帮我指导下,非常感谢!


 楼主| 魔剑烈皇 发表于 2013-8-2 10:35:16 | 显示全部楼层
什么原因没人知道吗?{:soso_e127:}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-3 19:36 , Processed in 0.091649 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表