<?
include(dirname(__FILE__)."/../../include/config.inc.php");

$z_ym = '9djxbj';
$z_ym_hz = 'com';


/*二级域名栏目列表*/
function list_allsub( $table ,  $parentId = 0 ){ //$modify 修改时显示所属分类 $showPId 当前的分类 id
    global $subdb,$webdb;
	$sql="select * from `$table`  where `s_bz_1` = 'sub' AND `parentId` = {$parentId} ORDER BY `list` DESC";
	//echo $sql."<br>";
    $result=mysql_query($sql);
    while($rs=mysql_fetch_array($result)){
	
		  $sub_a=explode('/',$rs["list_html"]);
		  $rs["sub_key"] = $sub_a["1"];

		  if( $parentId != 0 )$subdb[]=$rs;
		  list_allsub( $table , $rs['id'] );
   }
   //return $subdb;
}

list_allsub('w6_sort');
//print_r( $subdb );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--<?php
print <<<EOT
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>展示二级域名</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

.table {
	float: left;
	height: 190px;
	width: 500px;
	margin: 10px;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #CCCCCC;
}
.table .t1 {
	font-size: 12px;
	font-weight: bold;
	height: 26px;
	line-height: 26px;
}
.table .t2 {
	filter: Gray;
}
.lj {
filter:alpha(opacity=40); 
}
.gz {
	font-size: 12px;
	line-height: 14px;
	margin: 8px;
}
-->
</style>

<script language="Javascript">
function CopyText(obj) {
	ie = (document.all)? true:false
	if (ie){
		var rng = document.body.createTextRange();
		rng.moveToElementText(obj);
		rng.scrollIntoView();
		rng.select();
		rng.execCommand("Copy");
		rng.collapse(false);
		alert(obj.innerText+'被复制成功');
	}
}
</script>


</head>

<body>

<div style="clear:both"></div>
<hr />

<div class="gz">

apache的二级域名解析设置规则：


  <br />
  <br />
  
  <font color="#FF0000" title="点击即可实现复制" onClick="javascript:CopyText(this);">
  
  <p>&lt;Files ~ &quot;^.(htaccess|htpasswd)\$&quot;&gt;<br />
    deny from all<br />
    &lt;/Files&gt;</p>
  <p>#禁止列出目录文件<br />
  Options -indexes</p>
  <p>#自定义默认文档<br />
    DirectoryIndex index.htm index.html index.php <br />
    order deny,allow<br />
  </p>
  <p>RewriteEngine on</p>
  <!--
EOT;
foreach($subdb AS $key=>$rs){
print <<<EOT
-->

<br />
<p> <br />
  #让$rs[sub_key].$z_ym.$z_ym_hz 访问 1web 下的 $rs[sub_key] 目录</p>
<p>RewriteCond %{HTTP_HOST} ^$rs[sub_key].$z_ym.$z_ym_hz\$<br />
  RewriteCond %{REQUEST_URI} !^/1web/$rs[sub_key]/<br />
  RewriteCond %{REQUEST_FILENAME} !-f<br />
  RewriteCond %{REQUEST_FILENAME} !-d<br />
  RewriteRule ^(.*)\$ /1web/$rs[sub_key]/\$1<br />
  RewriteCond %{HTTP_HOST} ^$rs[sub_key].$z_ym.$z_ym_hz\$<br />
  RewriteRule ^(/)?\$ 1web/$rs[sub_key]/ [L]</p>
<p></p>

<!--
EOT;
}print <<<EOT
-->

<br />
<p>RewriteCond %{HTTP_HOST} ^($z_ym.$z_ym_hz)(:80)? [NC]<br />
  RewriteRule ^(.*) http://www.$z_ym.$z_ym_hz/\$1 [R=301,L]<br />
  order deny,allow</p>
<p>&nbsp;</p>
<p>#设置 404 页面</p>
<p>ErrorDocument 404 /404.html</p>
</font></div>


</body>

</html>
<!--
EOT;
?>
-->