<bdo id='hmmxS'></bdo><ul id='hmmxS'></ul>

    1. <legend id='hmmxS'><style id='hmmxS'><dir id='hmmxS'><q id='hmmxS'></q></dir></style></legend>
        <tfoot id='hmmxS'></tfoot>
      1. <i id='hmmxS'><tr id='hmmxS'><dt id='hmmxS'><q id='hmmxS'><span id='hmmxS'><b id='hmmxS'><form id='hmmxS'><ins id='hmmxS'></ins><ul id='hmmxS'></ul><sub id='hmmxS'></sub></form><legend id='hmmxS'></legend><bdo id='hmmxS'><pre id='hmmxS'><center id='hmmxS'></center></pre></bdo></b><th id='hmmxS'></th></span></q></dt></tr></i><div id='hmmxS'><tfoot id='hmmxS'></tfoot><dl id='hmmxS'><fieldset id='hmmxS'></fieldset></dl></div>

      2. <small id='hmmxS'></small><noframes id='hmmxS'>

        在 PHP 404 标头返回“哎呀!此链接似乎已损坏."

        时间:2024-08-22
      3. <tfoot id='UqPuk'></tfoot>
          <legend id='UqPuk'><style id='UqPuk'><dir id='UqPuk'><q id='UqPuk'></q></dir></style></legend>

            <bdo id='UqPuk'></bdo><ul id='UqPuk'></ul>

                • <i id='UqPuk'><tr id='UqPuk'><dt id='UqPuk'><q id='UqPuk'><span id='UqPuk'><b id='UqPuk'><form id='UqPuk'><ins id='UqPuk'></ins><ul id='UqPuk'></ul><sub id='UqPuk'></sub></form><legend id='UqPuk'></legend><bdo id='UqPuk'><pre id='UqPuk'><center id='UqPuk'></center></pre></bdo></b><th id='UqPuk'></th></span></q></dt></tr></i><div id='UqPuk'><tfoot id='UqPuk'></tfoot><dl id='UqPuk'><fieldset id='UqPuk'></fieldset></dl></div>

                  <small id='UqPuk'></small><noframes id='UqPuk'>

                    <tbody id='UqPuk'></tbody>
                  本文介绍了在 PHP 404 标头返回“哎呀!此链接似乎已损坏."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  长话短说,我在网站上有显示评论的动态页面.如果没有与特定城市/县/地区/等相关的评论,则 mysql 查询返回 0 行,触发以下代码:

                  To make a long story short, I have dynamic pages on a website that display reviews. If there are no reviews associated with a particular city/county/area/etc the mysql query returns 0 rows which triggers the following code:

                  if (!$validRevQuery) {
                      header("HTTP/1.0 404 Not Found");
                      include("http://{$PDS['site']}/404.php?request=".urlencode($_SERVER['REQUEST_URI']));
                      exit;
                  }
                  

                  在某些网络主机上,这会触发URL 文件访问被禁用"错误.这很好,但是在允许 URL 文件访问的那些上,404 文件被包含并正确显示.我稍微更改了代码以显示绝对路径,如下所示:

                  On some webhosts this triggers a "URL file-access is disabled" error. Which is fine, but on the ones that allow URL file-access, the 404 file is included and properly displayed. I changed the code slightly to display an absolute path like so:

                  if (!$validRevQuery) {
                      header("HTTP/1.0 404 Not Found");
                      $_GET['request'] = urlencode($_SERVER['REQUEST_URI']);
                      include($_SERVER['DOCUMENT_ROOT']."/404.php");
                      exit;
                  }
                  

                  现在,它给了我通用的糟糕!此链接似乎已损坏".错误页面.(我有谷歌工具栏,所以这可能因浏览器和插件而异).不知道为什么会发生这种情况,因此感谢您的帮助!

                  And now, it's giving me the generic "Oops! This link appears to be broken." error page. (I have google toolbar, so this may be different depending upon browser and plugins). No idea why this is happening, so any help is appreciated!

                  推荐答案

                  你的问题与你包含的内容无关:是你的页面太小了.

                  Your problem has nothing to do with what you include: It's that your page is too small.

                  根据我的经验,Chrome 的内置糟糕"页面会显示,就像 Internet Explorer 中的页面一样,当页面仅发出 404 标头并且内容的字节数少于定义的字节数时(我认为它是 512 字节)IE,不知道 Chrome 的限制).

                  In my experience, Chrome's built-in "Oops" page is displayed, like the one in Internet Explorer, when the page emits only the 404 header and less than a defined number of bytes of content (I think it's 512 bytes in IE, don't know the limit in Chrome).

                  我倾向于在我的 404 页面中填充数百字节的 HTML 注释中的无意义内容,以确保显示自定义 404 页面.

                  I tend to pad my 404 pages with a few hundred bytes of meaningless content wrapped in HTML comments to make sure the custom 404 page is displayed.

                  或者当然,利用这个机会来一些很酷的 ASCII 艺术

                  Or of course, use the opportunity for some cool ASCII Art!

                     <!--                            oooo   ooo
                                                     $   $  $   $
                                                     "o  $ $  o""
                                                       o  "   "ooooo
                                                   oo ""           o$
                                     o            o            oo  "
                                    $$             $o$""$o  ooo$
                                    $"$          o $    "$  $
                          o$o       $ "$         $ $     $ $
                           $$$o     $$ "$       o$ $     o $o
                           "$ ""o   "$   "o     $$ "o     o"
                       $o   $$   "o  $     "oo  $"  $   o$"
                        "$   $o    "o$$       "o$    $o$" oo$
                          "o "$o                     "$o $"$$
                            "        oo$$$$$$$oo        $oo$$""      o" o
                   """""""""      o$$$$$$$$$$$"$o             o"""$o$$  o$
                         ooo$$$"o$$$$$$$$$$$$$$ "$o    o   o$$$o   $ $ o$
                      o$$$$$$$$$$$$$$$$$$$$$$$$    "oo  o      ""o  "$ $
                     $$$$$$$$$$$$$$$$$$$$$$$$$$      "$o   o$$"""$     " oo""o
                  o""""$$$$$$$$$$$$$$$$$$$$$$"         ""$o"$o          "   o$
                       "$$$$$$$$""""$""$$$""              "$oo$""$o     o$"""
                        $$$$$$$"                           $""""$"  o""""
                         $"""""$ooooo        ooooo$$$$$$$     o$" o"
                          $     """" oooo$$$$$$$$$$$$$$"     $"  o"
                        oo$   oooo$$$$$$$$$$$"""""$$$$"    o$" o$"
                      "$ $o$$$$$$$$$$$$$""$     o$$$"oooo$"  o"
                        "o$ "$$$$$$$$$$$$         $$o$"$$$   $"
                          "$  ""$$$$$$$$$        o$"$$$ "$$o$$
                            "o   ""$$$$$$o     o$$$$ ""$o """$
                              "$o    ""$$$$$$o"  o$$$$oo o$$$$
                                 ""$oo     $$" "$$$"" ooooooo$
                                      """"$"  o$"   oo$$$$$""$$
                                         $ oo$"  o$$$$$""  ooo$
                                         $o$"  o$$$$"  oo$$$$$$$o
                                          $$ o$$$"  o$$$$$$"""""$o
                                           "o$$"  o$$$$""  o$$$$$$$o
                                             "$oo$$$$"  o$$$$$""" o$o
                                               "$$$" oo$$$"" oo$$$$$$$
                                            ooooo$oo$$$"" oo$$$$"""$$""
                                           $"oooo $$$" o$$$$""      $
                                         o$"o$   $$"oo$$""       " o$
                                         $ o$$o  $$o$$"          oo$$
                                         $ $$$$  $$$$$$$$$$$$$$$$$$$$
                                         $ $$$$  $$$$$$$$$$$$$$$$$$$$"
                                         $ $$$$  $$$$$$$$$$$$$$$$$$$$
                                         $ ""    ""$$$$$$$$$"""$""""
                                         $o         $"$"    " $"
                                          $o       $$  $o    o$
                                           "$o   o$$    ""$$$"
                                             """"""  -->
                  

                  这篇关于在 PHP 404 标头返回“哎呀!此链接似乎已损坏."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:资源解释为文档,但使用 MIME 类型 text/css 传输 下一篇:打开下载的 zip 文件会创建 cpgz 文件吗?

                  相关文章

                • <small id='YTPvW'></small><noframes id='YTPvW'>

                • <legend id='YTPvW'><style id='YTPvW'><dir id='YTPvW'><q id='YTPvW'></q></dir></style></legend>
                • <tfoot id='YTPvW'></tfoot>
                      <i id='YTPvW'><tr id='YTPvW'><dt id='YTPvW'><q id='YTPvW'><span id='YTPvW'><b id='YTPvW'><form id='YTPvW'><ins id='YTPvW'></ins><ul id='YTPvW'></ul><sub id='YTPvW'></sub></form><legend id='YTPvW'></legend><bdo id='YTPvW'><pre id='YTPvW'><center id='YTPvW'></center></pre></bdo></b><th id='YTPvW'></th></span></q></dt></tr></i><div id='YTPvW'><tfoot id='YTPvW'></tfoot><dl id='YTPvW'><fieldset id='YTPvW'></fieldset></dl></div>
                        <bdo id='YTPvW'></bdo><ul id='YTPvW'></ul>