douyan1453 2012-05-14 12:23
浏览 28

创建错误页面并修改htaccess?

Iam trying to create error pages for my website, I created an .htaccess file with the following code:

ErrorDocument 403 /403.htm`

ErrorDocument 404 /404.htm

I also created the html files, I uploaded it in the root directory but it doesn't work.

Coould anyone tell me if I am doing anything wrong?

Thanks in advance

Blockquote

  • 写回答

1条回答 默认 最新

  • douque9815 2012-05-14 13:43
    关注

    First, I would try something like adding this directive, and testing a 404 to see if it works:

    ErrorDocument 404 "Sorry, no file here"
    

    If you don't get that error, then in all likelihood your .htaccess file isn't being processed. You need to make sure that it's enabled on your server, etc. It is also possible that your ErrorDocument directive is specified somewhere that it isn't being read for the context where you are testing.

    If you do get that error, the next thing I would do is make sure that your error documents are where you think they are. You mention that you uploaded them to the root directory of your project, so I would try browsing to them and see what happens.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂