appache 中设置自定义404、403错误

WBOY
Release: 2016-06-23 13:40:31
Original
1491 people have browsed it

文件结构如下 服务器根目录是 htdocs  ,这下面有 phpMyAdmin 和  w 两个文件夹,其中 我的网站放在 w下,我需要使用.htaccess 配置文件 来定义自己的403/404页面,   于是建立了一个 .htaccess 文件 ,添加内容   ErrorDocument 404 /404.html
ErrorDocument 403 /403.html  ,并且在[c怎么下 增加了两个html 页面 分别是 403.html   404.html。现在问题就是 ,不会跳到错误页面,我要怎么做,请大神指点迷津。因为服务器的原因,只能使用 .htaccess 方式配置



 


回复讨论(解决方案)

.htaccess
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html

+htdocs
  +phpMyAdmin
  +w
    index.php
  .htaccess
  403.jtml
  404.html

版主GG 太棒了

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!