简体   繁体   English

PHP F3 的路由匹配“http://...”地址

[英]Route with PHP F3 matching an "http://..." adress

I am working with PHP F3.我正在使用 PHP F3。 I have some issues with their routing engine.我的路由引擎有一些问题。

Let say my website is www.test.com , I would like to have a special handler when I enter this url: www.test.com/https://www.google.com/假设我的网站是www.test.com ,当我输入这个 url 时,我想有一个特殊的处理程序: www.test.com/https ://www.google.com/

I want to get the "https://www.google.com/" part and store it in a database.我想获取“https://www.google.com/”部分并将其存储在数据库中。

For now I have this route: GET /*=Page->myHandler现在我有这条路线: GET /*=Page->myHandler

which is not working when there are:, ., ?, etc symbols当有:,.,?等符号时,它不起作用

My guess is to rewrite a special routing function for this case but how to bypass the existing one?我的猜测是为这种情况重写一个特殊的路由 function 但是如何绕过现有的?

Yeah it's directly working against how the regex for the routing engine is parsing things in the Base->run() method.是的,它直接与路由引擎的正则表达式在Base->run()方法中解析事物的方式相悖。 If I were to make a recommendation I would put your endpoint as something like myapp.com/incoming-url?url=[the url encoded URL you want to save in the database] If it's not URL encoded, even the browser will have a tough time figuring out what you want to do. If I were to make a recommendation I would put your endpoint as something like myapp.com/incoming-url?url=[the url encoded URL you want to save in the database] If it's not URL encoded, even the browser will have a很难弄清楚你想做什么。

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

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