爲什麼$_SERVER["SERVER_NAME"]
不能回顯www
的www.example.com
,但是當我從子域名如test.example.com
迴應時,它確實有效?
0
A
回答
6
我不知道它爲什麼不包含預期值。但是請嘗試使用$_SERVER['HTTP_HOST']
,其中包含客戶端在HTTP header field Host中提供的值。但出於安全考慮,請參閱Chris Shiftlett’s SERVER_NAME
Versus HTTP_HOST
。
相關問題
- 1. ServerAlias影響$ _SERVER ['SERVER_NAME']?
- 2. VIM:用$ server_name搜索並替換$ _SERVER ['SERVER_NAME']
- 3. 圖像路徑和$ _SERVER ['SERVER_NAME']
- 4. $ _SERVER ['SERVER_NAME']是僞造/僞造的嗎?
- 5. TImage Not Showing up
- 6. inputaccessoryview not showing(StoryBoard)
- 7. Radibuttons not showing up
- 8. PyQt5 PushButton not showing
- 9. ControlTemplate not showing Grid
- 10. Recycler View Not Showing
- 11. TabNavigator not showing children
- 12. img not showing
- 13. Android ViewPager not Showing
- 14. iPad UIActionSheet not showing
- 15. MapView not Showing annotation
- 16. Facebook og:image not showing
- 17. Addsubview not showing uiimageview
- 18. Scatterplot Not Showing
- 19. navigationItem not showing
- 20. MFMailComposer not showing UIAlertController
- 21. Android:ProgressDialog Circle not showing
- 22. Rails:Frameset not showing
- 23. Android:Drawable not showing up
- 24. Sencha emptyText not showing
- 25. Android - DialogFragment not Showing
- 26. Opencart Footer Not Showing Not logged
- 27. CSS background-image not showing
- 28. DateComponents and Notifications Not Showing
- 29. jquery append not showing div
- 30. Forge Viewer:material/texture not showing
打印什麼? – 2009-09-26 17:50:47
它打印example.com – Andres 2009-09-26 17:53:24
'example.com'可能是您的服務器/虛擬主機的規範服務器名稱。請參閱http://httpd.apache.org/docs/2.2/mod/core.html#usecanonicalname – Gumbo 2009-09-26 17:54:39