dongzhong9055 2016-09-07 10:52
浏览 64
已采纳

404页面将如何工作

This is my error page i dont know exactly what is but i want to redirect this kind of error to 404.html page:

Error

  1. I have created a 404 error page name "404.html". I want to redirect to this if no file or folder exist in my server.
  2. Where do I have to place this page (404.html)?
  3. Is it possible to redirect this page in .htaccess (or possible with only .htaccess)?
  4. If is there anything more about 404 page let me know, I want to grab the knowledge.

And don't vote me down if possible of copy!

I want to map one error document file for 404 500 i am trying with this code.

ErrorDocument 404 /404.html
ErrorDocument 500 /404.html

RewriteEngine On
RewriteBase /

# map them to one error document:
RewriteCond %{REQUEST_URI} ^/404/$ [OR]
RewriteCond %{REQUEST_URI} ^/500/$
RewriteRule ^(.*)$ /404.html [L]

I tried this code and uploaded the file in main folder www.website.com/404.html

  • 写回答

3条回答 默认 最新

  • douqilin4296 2016-09-07 10:56
    关注
    1. No answer needed.
    2. Where you want on your server
    3. Yes : ErrorDocument 404 /yourPath/404.html
    4. Google and Apache docs are your friends.

    Edit : You add an image on your question. This is a 500 Internal Server Error, and not a 404 Page not Found error. Handle it with

    ErrorDocument 500 /yourPath/500.html
    

    But if your .htaccess file is corrupted and cause this error, you first have to fix your .htaccess file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)