문제

I understand how using a full domain with an A record works ($_SERVER['SERVER_NAME']), but when using a subdomain with bit.ly, they ask for it to point to cname.bit.ly - why dont subdomains just get pointed to the same IP address as normal domains and is there a difference in determining the referring sub-domain?

도움이 되었습니까?

해결책

there is no difference having a hostname either as cname or A-Record. $_SERVER['SERVER_NAME'] has nothing to do with that. Cname is not a http-redirect.

If you want to determine the host (as requested by the user via http/1.1) which was requested in using your script, use $_SERVBER['HTTP_HOST]

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top