dongzong1866 2013-05-14 20:00
浏览 38

根据域显示不同的内容

I currently run two domains on the same server. Both websites use the same files.

Is it possible to utilize javascript or jquery or something else to display certain page content based on which domain the user is accessing from?

For example. If user arrives from "www.site1.com" can I make the page display a different css template than if they access from "www.site2.com".

I hope this makes sense. Thanks.

  • 写回答

3条回答 默认 最新

  • douju6542 2013-05-14 20:03
    关注

    You can check the $_SERVER['HTTP_REFERER'] value to try to learn where from your user has came (it has nothing to do with the domain name of application he has came to). This value might be useful but you shouldn't depend on it, because it can be easily changed (it's one of the headers web browser may set when following a link).

    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致