Thanks @acf-support !
You info let me to use REQUEST_URI instead 🙂
Referer did return the prev url when visiting, or nothing if directly visited.
Referer return:
http://www.domain.com/old_path/
Request return:
/current_real_path/
url_to_postid the return:
id: 48
id: 115 (correct)