个中一个方法是:

首先打开mod_proxy,mod_proxy_http和mod_rewrite支持,即在Apache的配置文件http.conf中去掉相应LoadModule的注释。

在iis里那个站点不用80端口,用其它端口如8080apache用80,其余再在apache里建个虚拟主机(iis那个站点的)<VirtualHost 221.13.122.234:80> ServerName"www.test.com" ProxyPass /http://www.test.com:8080/</VirtualHost>利用apache的反向代理功能就能把8080隐蔽了而在apahce里建的那个站点还是能用80访问,互不影响但是我用的thinkphp 的框架,用这个办法二级目录网址就不能访问那只能用301跳转1)IIS容器实现301转向:1.internet信息做事管理器中,在想要重定向的网页或目录上点击鼠标右键2.选择-重定向到URL3.输入目标页面的地址4.选中-资源的永久重定向5.运用并确定2)Apache容器下修正方法:1、修正.htaccess文件,输入下列内容(须要开启mod_rewrite):①将不带WWW的域名转向到带WWW的域名下:RewriteEngine onRewriteCond %{HTTP_HOST} ^itdcw.com [NC]RewriteRule ^(.)$ http://www.itdcw.com/ [L,R=301]②重定向到新域名:RewriteEngine onRewriteRule ^(.)$ http://www.itdcw.com/ [L,R=301]2、Apache下vhosts.conf中配置301转向: <VirtualHost :80>ServerName www.itdcw.comDocumentRoot /home/</VirtualHost><VirtualHost :80>ServerName itdcw.comRedirectMatch permanent ^/(.) http://www.itdcw.com/</VirtualHost> 我用的这个3)Ruby容器中实现301转向: def old_actionheaders["Status"] = "301 Moved Permanently"redirect_to "http://www.itdcw.com"end 4)Coldfusion容器中实现301转向: <.cfheader statuscode="301" statustext="Moved permanently"><.cfheader name="Location" value="http://www.itdcw.com"> 二、程序措辞跳转方法:1、ASP的301跳转代码: <%@ Language="VBScript" %><%Response.Status = "301 Moved Permanently"Response.AddHeader "Location", "http://www.itdcw.com"%> 2、PHP的301跳转代码: <?header("HTTP/1.1 301 Moved Permanently");header("Location:http://www.itdcw.com");exit();?> 3、ASP.Net的301跳转代码: <script runat="server">private void Page_Load(object sender, System.EventArgs e){Response.Status = "301 Moved Permanently";Response.AddHeader("Location","http://www.itdcw.com");}</script> 4、CGI Perl的301跳转代码: $q = new CGI;print $q->redirect("http://www.itdcw.com"); 5、JSP的301跳转代码: <%response.setStatus(301);response.setHeader( "Location", "http://www.itdcw.com" );response.setHeader( "Connection", "close" );%>

jsp301iis和apache共存并且二级目次能拜访 PHP