php 错误 310(网络::ERR_TOO_MANY_REDIRECTS):

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10544869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 22:26:12  来源:igfitidea点击:

Error 310 (net::ERR_TOO_MANY_REDIRECTS):

phpredirect

提问by arboles

I am not getting this error on my local host, only when i upload to my server does this error appear, on one of my pages. any idea what i need to change?

我在本地主机上没有收到此错误,只有当我上传到我的服务器时,我的其中一个页面上才会出现此错误。知道我需要改变什么吗?

回答by Michael Blood

I have run into this error in a web browser in which a webpage I went to redirects to another web page that redirects back to the original endlessly, I have also run into situations where a programming error continuously reloads or redirects the page to itself.

我在 Web 浏览器中遇到了此错误,其中我去的网页重定向到另一个网页,该网页无休止地重定向回原始网页,我还遇到过编程错误不断重新加载或将页面重定向到自身的情况。

The way to trouble shoot this type of problem is to actually watch the requests your browser is making to the server. You should be able to see multiple individual requests before this error comes up.

解决此类问题的方法是实际观察浏览器向服务器发出的请求。在出现此错误之前,您应该能够看到多个单独的请求。

You can see the requests your browser makes using the network tab of the developer tools in Chrome (Ctrl+Shift+J) or the network tag of Firebug in firefox. I think IE9 has a network tool in their developer tools (F12) but I cant remember, and I cant think of a good enough reason to open IE9 to check. But if it doesn't have a network tool you can install the free version of HTTPWatch, which allows you to watch the individual requests made by your browser.

您可以使用 Chrome 中开发者工具的网络选项卡 (Ctrl+Shift+J) 或 firefox 中的 Firebug 网络标签查看浏览器发出的请求。我认为IE9在他们的开发人员工具(F12)中有一个网络工具但我不记得了,我想不出足够好的理由打开IE9进行检查。但是如果它没有网络工具,您可以安装免费版本的 HTTPWatch,它允许您观看浏览器发出的单个请求。

And, if none of these work, you can always install Fiddler or WireShare which sniff the packets and requests made by your browser.

而且,如果这些都不起作用,您可以随时安装 Fiddler 或 WireShare,它们会嗅探浏览器发出的数据包和请求。

回答by Akshay Kumbhar

localhost and web-servers are different path for your files so you need to edit .htaccess file for get actual base-path and add this line of code int it

localhost 和 web-servers 是您文件的不同路径,因此您需要编辑 .htaccess 文件以获得实际的基本路径并在其中添加这行代码

RewriteEngine On

# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
RewriteBase (your physical path)

.......

its all about .htaccess error

都是关于 .htaccess 错误的