简体   繁体   English

从另一个站点重定向后,如何获取上一页的URL?

[英]How get previous page url after redirect from another site?

Is there any way to get the redirected site url? 有什么方法可以获取重定向的网站网址? I am just curious about how to get the code of TinyUrl . 我只是很好奇如何获取TinyUrl的代码。 Suppose I have created an url on tinyurl like http://ty.com/abcdef and this is to be redirected to my site like http://example.com/some-another-url . 假设我已经在tinyurl上创建了一个URL,例如http://ty.com/abcdef并将其重定向到我的网站,例如http://example.com/some-another-url How do I get the code of tinyurl from http://example.com/some-another-url ? 如何从http://example.com/some-another-url获取tinyurl的代码?

** ty.com for tinyurl.com ** ty.com为tinyurl.com

You can use 您可以使用

$_SERVER['HTTP_REFERER']; $ _SERVER [ 'HTTP_REFERER'];

PS: This is unreliable as it may not work with secure pages (HTTPS) PS: 这是不可靠的,因为它可能不适用于安全页面(HTTPS)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM