如何重定向到外部链接(网址),无论在拉拉维尔中是否给出http或https


How to redirect to an external link ( url ) no matter the http or https are given or not in Laravel

在Laravel中,Redirect::to需要与http(s)://的完整链接,在Jefrey缩短器教程中,他只使用完整的URL来测试应用程序,即使url验证器只有在给定完整url时才通过。任何其他方法或其他 php 函数使用该重定向到没有 http(s)//的网址?

只需使用

Redirect::away('http(s)://')