gpt4 book ai didi

.htaccess - 自定义 404 错误页面问题

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:45:58 25 4
gpt4 key购买 nike

我遇到了自定义 404 页面问题我的目录如下

  1. index.php
  2. 404.php

我的 htaccess 代码是..

Options +FollowSymLinks
RewriteEngine on
RewriteRule ([0-9])/ index.php?page=$1

#DirectoryIndex practice.php

IndexIgnore *.gif *.jpg *.png *.css

ErrorDocument 404 practice.php

问题是 404.php 页面在 url 输入错误时显示但未显示页面内容看图片

enter image description here

404页面内容是:

<h1 align='center'>404 - Page Not Found </h1>

最佳答案

许多浏览器要求自定义 404 页面的大小至少为 512 字节。
如果自定义 404 页面不是那么大的文件,那么浏览器只会显示其默认的 404 页面。

答案:在您的自定义 404 页面上放置更多内容。
此外,修复 ErrorDocument 行:ErrorDocument 404 404.php

关于.htaccess - 自定义 404 错误页面问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16508768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com