草庐IT

redirections

全部标签

php - react : Preserve cookies when redirecting to sub-domain

我需要在成功验证后将用户重定向到它自己的子域company.test.com来自test.com授权页面在test.com上打开,当我收到成功授权的响应时,我从数据库中获取了用户的子域名。所以公司名称xyz应该重定向到xzy.test.com,这部分已经完成。问题是用户的session。我将经过身份验证的用户数据保存到redux中,当页面刷新/重定向到子域时,它会丢失用户数据。我能想到的是,我应该将经过身份验证的用户id以及子域(如xyz.test.com/encrypted-user-id)传递给路由,我将在后端获取该用户ID并将其解密,并强制用户登录而无需再次询问密码。我的问题是.

php header 位置与 php_redirect

PHP中的函数"HTTP_redirect"和"headerlocation"有什么区别?什么时候必须使用函数"HTTP_redirect"?什么时候必须使用函数“headerlocation”?看那个:https://php.net/manual/en/function.http-redirect.php-->HTTP_redirect手册https://php.net/manual/en/function.header.php-->函数头手册 最佳答案 http_redirect基本上是一个辅助函数,通过允许您为GET数据传递一

php - 什么是 php $_SERVER ['REDIRECT_STATUS' ]?

使用php,我可以在$_SERVER数组中看到索引“REDIRECT_STATUS”,但php.net没有提及它。我有一个抛出404的自定义错误页面,但“REDIRECT_STATUS”仍然是200。那么状态代码究竟指的是什么? 最佳答案 php-srccode建议documentationlink,即Formoreinformationastowhythisbehaviourexists,seethe\manualpageforCGIsecurity.\n\阅读有关CGI安全性的信息。使用REDIRECT_STATUS变量-它不是

php - http_redirect() 与 header()

这个问题在这里已经有了答案:关闭9年前。PossibleDuplicate:phpheaderlocationvsphp_redirect多年来我一直在使用PHP,我总是通过header('Location:example.com')函数重定向到另一个URL。今天在浏览php.net时,我注意到有一个专门用于重定向的函数,名为http_redirect()将http_redirect()用于header()或相反有什么好处吗?引用资料:http://www.php.net/manual/en/function.header.phphttp://php.net/manual/en/fun

php - mod_rewrite : How to redirect HTTP DELETE and PUT

我正在尝试使用mod_rewrite在php中编写一些restapi。我的问题是:如何处理HTTPDELETE和PUT?例如,网址为:/书/1234其中1234是一本书的唯一ID。我想使用id作为参数将此id(1234)“重定向”到book.php。我已经知道如何在php脚本中读取PUT和DELETE变量,但如何在mod_rewrite中设置此重写规则?有什么想法吗?编辑:GET的重写规则如下所示:RewriteRulebook/([0-9]+)book.php?id=$1[QSA]如何为PUT和DELETE执行此“参数转发”?据我所知,HTTPPOST、PUT和DELETE使用HTT

php - 警告 : file_get_contents: failed to open stream: Redirection limit reached, 中止

我在这个网站上阅读了20多个相关问题,在Google中搜索但没有用。我是PHP的新手,正在使用PHPSimpleHTMLDOMParser来获取URL。虽然此脚本适用于本地测试页面,但它不适用于我需要该脚本的URL。这是我为此编写的代码,遵循PHP简单DOM解析器库附带的示例文件:find('li.nameul#generalListing')as$e)echo$e->plaintext;?>这是我收到的错误消息:Warning:file_get_contents(http://www.farmersagent.com/Results.aspx?isa=1&name=A&

php - 拉维尔 4 : Redirect a post request to different controller method

我有一个如下所示的Controller,我的Controller:publicfunctionmethodA(){returnInput::get('n')*10;}publicfunctionmethodB(){returnInput::get('n')*20;}我想根据POST值调用MyController中的一个方法。routes.phpRoute::post('/',function(){$flag=Input::get('flag');if($flag==1){//executemethodAandreturnthevalue}else{//executemethodBand

php - 使用 PHP 和 nginx X-Accel-Redirect 服务大文件

您好,我希望用户能够从我配置了nginxPHP的服务器(Windows)下载PDF文件。这是我的nginx.conf(服务器block)http{includemime.types;default_typeapplication/octet-stream;sendfileon;keepalive_timeout65;server{listen80;server_namelocalhost;location/{roothtml;indexindex.php;}location/download{internal;alias/protected;}}}..和PHP文件(头部分)$file=

php - Zend Framework - 如何从 Action 助手中调用 Controller 的 redirect()

我正在ActionHelper的preDispatch方法中进行ACL检查。当它失败时,我想调用ActionController的_redirect方法,但是我很难做到这一点。在这篇文章所附的评论中,zend-framework,callanactionhelperfromwithinanotheractionhelper,我看到两个解决方案。首先,Controller作为$this->_actionController从helper访问。在第二个中,使用$this->getActionController()访问它。我尝试了以下两种方法:$this->_actionControlle

php - Wordpress 远程导致 "This webpage has a redirect loop"错误

我有一个在开发中运行良好的Wordpress站点(在mysite.dev),但是当我将它部署到我的远程服务器(mysite.com)时,它抛出“此网页有重定向循环”错误。我可以在加载栏中看到浏览器正在尝试访问www.mysite.com然后是mysite.com然后是www.mysite.com,但是我不确定这是否相关。如果我的Wordpress数据库配置不正确,我会收到建立数据库连接时出错消息,但是当一切设置正确时,它会在这个重定向循环中中断。我已更改数据库中的字段(siteurl)以反射(reflect)远程设置(http://mysite.com/wordpress)。注意:除了