How can I forbid access to an URL in PHP? -
if have url called: www.example.com
, have application in next url: www.example.com/app/
, how can forbid access www.example.com
not app? simple way?
thanks.
if need within php, can set right http status , exit program:
if ($_server['path_info'] === '/') { header('', false, 403); die('access forbidden.'); }
see header() docs , description of http homecoming codes.
but in general case, @cooper , others right, server config improve location handle globally.
php
No comments:
Post a Comment