PHP更改URL而不重定向到它吗? [英] PHP alter URL without redirecting to it?

查看:35
本文介绍了PHP更改URL而不重定向到它吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用php更改网址或网址的一部分?我丢失了使用的代码,现在无法在线找到答案.

How can I alter url or part of it using php? I lost the code that I have used and now I cannot find answer online.

我知道使用header('Location: www.site.com')会得到重定向,但是如何显示伪造的URL?

I know using header('Location: www.site.com') gets redirect but how can I just show fake URL?

我现在不想使用mod_rewrite.

I don't want to use mod_rewrite now.

推荐答案

您可以尝试使用

file_get_contents("https://website.com");

这不会重定向,但会触发api,您可以通过将变量分配给上述函数来捕获输出.

This is not going to redirect but fire the api and you can catch the output by assigning a variable to above function.

这篇关于PHP更改URL而不重定向到它吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆