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

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

        标头位置相对路径兼容性

        Header Location relative path compatibility(标头位置相对路径兼容性)

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

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

                  <tfoot id='aGRkE'></tfoot>

                1. 本文介绍了标头位置相对路径兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  这个相对位置 html 标头是否与所有平台的所有浏览器绝对兼容?有什么标准吗?

                  Is this relative location html header absolutely compatible with all browsers at all platforms? Any standards ?

                  Location: some_script.php?la=2&po=2030
                  

                  我的意思是,它是否总是重定向到当前目录的 some_script.php?

                  I mean, will it always redirect to some_script.php at the current dir or not?

                  推荐答案

                  标准是这样的:

                  header('Location: http://www.mywebsite.com/yourpage.php?id=32', TRUE, 302);
                  

                  但要回答您的问题,是的,如果您不首先输入斜杠或完整的 URL,它将重定向到当前文件夹中的页面 X.

                  But to answer your question, yes it will redirect to the page X in the current folder if you don't put a slash at first or a complete URL.

                  我建议您为您所做的每个网站都这样做.在您的主文件(您使用的主 php 文件,如 config 或其他文件)中,创建类似的内容:

                  Here's an idea I would suggest you do for every website you do. In your primary file (the main php file you use like config or whatever), create something like that :

                  define('URL', 'http://www.mywebsite.com/');
                  

                  因此,当您创建重定向、链接或其他内容时,您可以这样做:

                  So when you create a redirection, a link or whatever, you do this :

                  header('Location: '.URL.'yourpage.php?id=32', TRUE, 302);
                  

                  2017 年 11 月.正如下面 @jordanbtucker 所指出的,HTTP 规范已在 2014 年 6 月更新(这篇文章来自 2012 年),以允许在 Location 标头中使用相对 URI.

                  November 2017. As pointed by @jordanbtucker below, the HTTP spec has been updated in June 2014 (this post is from 2012) to allow relative URIs in the Location header.

                  这篇关于标头位置相对路径兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                2. <legend id='PAOEI'><style id='PAOEI'><dir id='PAOEI'><q id='PAOEI'></q></dir></style></legend>
                  <i id='PAOEI'><tr id='PAOEI'><dt id='PAOEI'><q id='PAOEI'><span id='PAOEI'><b id='PAOEI'><form id='PAOEI'><ins id='PAOEI'></ins><ul id='PAOEI'></ul><sub id='PAOEI'></sub></form><legend id='PAOEI'></legend><bdo id='PAOEI'><pre id='PAOEI'><center id='PAOEI'></center></pre></bdo></b><th id='PAOEI'></th></span></q></dt></tr></i><div id='PAOEI'><tfoot id='PAOEI'></tfoot><dl id='PAOEI'><fieldset id='PAOEI'></fieldset></dl></div>
                      <tbody id='PAOEI'></tbody>
                      <tfoot id='PAOEI'></tfoot>

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

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