简体   繁体   中英

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

I am working with 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/

I want to get the "https://www.google.com/" part and store it in a database.

For now I have this route: 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?

Yeah it's directly working against how the regex for the routing engine is parsing things in the Base->run() method. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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