rtfc 发表于 2015-8-3 09:20:30

apache ci 的404设置

  服务器异常信息,越少泄露越好。为避免一些探测url的异常,我们需要定制404页。
  1.apache
  httpd.conf里:对一节中,增加:
  ErrorDocument 404 /404.html
    ErrorDocument 403 /404.html
  原始文件:
  把 error/HTTP_NOT_FOUND.html.var下的HTTP_NOT_FOUND.html.var改成你想要的页就可以了
要是改路径就在httpd.conf中设 ErrorDocument 404/
  2.ci默认
  默认404页面在 application\errors 目录下。
  3.routes.php 设置
  $route['404_override'] = 'Index/error_404';
  这里会把一些controller层的异常url,跳转到指定的controller上。
  4.目录
  在目录下放置index.html页面。禁止文件目录浏览。
  #开启目录列表索引模式
Options Indexes
  禁用:Options -Indexes
  4.监控apache
  
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1

  
页: [1]
查看完整版本: apache ci 的404设置