php - http header redirect from multiple sources -
this working setup
main-page --> forum-page
you can access forum-page when coming main-page. if access forum-page anywhere else main-page.
here's code on forum-page , works intended
if($_server['http_referer']!=='https://homepage.com/folder/mainpage.php') { header('location: https://homepage.com/folder/mainpage.php'); exit; }
but
if come forum-subpage main-page. forum-page looks this
https://homepage.com/folder/forumpage.php?page=view&entry=16
this want achieve
main-page --> forum-page <-- forum-subpages
so need rule on forum-page accept return forum-subpage. since can't define every subpage want add wildcard @ end this
https://homepage.com/folder/forumpage.php?page=*
i don't know how add correct syntax first rule above make work. ideas highly appreciated.
i guess this
if($_server['http_referer']!=='https://homepage.com/folder/mainpage.php' && substr($_server['http_referer'], 0, 47) !== 'https://homepage.com/folder/forumpage.php?page=') { header('location: https://homepage.com/folder/mainpage.php'); exit; }
this setup worries me though. wouldn't rely on $_server['http_referer']
; browsers not guaranteed set or @ all. concerns me question tagged security provides no real security.
Comments
Post a Comment