dprxj1995 2011-01-30 20:53
浏览 57
已采纳

php中的全局重定向从something.com到www.something.com

I'm a .net developer and I've just started developing a site on PHP running on IIS7-fastcgi.

I was wondering if there is any way to write a global function to automatically redirect any request that comes to my site in the format

http://something.com/anypage.php 
to
http://www.something.com/anypage.php

You can do this in ASP.NET on the global.asax file. IS there any way to do this or set this condition in php?

  • 写回答

4条回答 默认 最新

  • douge3830 2011-01-30 20:55
    关注

    I don't think so..but you can do this using .htaccess

    (edited to include comment below):

    or the iis7 equivalent I guess is what you want http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型