IXwebhosting如何在一个IP下做多个站【申精】
|
|
众所周知,IXwebhosting在一个IP下只能做一个站,独立IP用完之后,新建站的话用的都是共享IP,可是国外的IP经常面临被封的命运,所以很多人都想在一个IP下面建多个站。
用IX差不多快1年了,以前没有注意过,经过前一段时间的测试,发现完全可以实现。
因为IX的空间支持.htaccess文件,况且网站都是独立IP,所以我们将网站的域名解析到自己的独立IP,然后在独立IP所在网站的根目录建立一个子文件夹.
例:我现在要在76.163.217.47这个IP下面再做一个站,原有的站是www.92proxy.cn
现在我想再建一个www.86meishi.com的网站。
于是我先在www.92proxy.cn的根目录建立一个meishi的文件夹,然后制作了一个.htaccess文件。- DirectoryIndex default.php index.htm index.php index.html default.htm default.html index.shtml default.shtml
- RewriteEngine On
- Options All -Indexes
- php_value upload_max_filesize 20M
- RewriteEngine on
- RewriteCond %{HTTP_HOST} ^(www.)?lenfans.cn$
- RewriteCond %{REQUEST_URI} !^/lenfans/
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ /lenfans/$1
- RewriteCond %{HTTP_HOST} ^(www.)?lenfans.cn$
- RewriteRule ^(/)?$ lenfans/index.php [L]
- RewriteEngine on
- RewriteCond %{HTTP_HOST} ^(www.)?86meishi.com$
- RewriteCond %{REQUEST_URI} !^/meishi/
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ /meishi/$1
- RewriteCond %{HTTP_HOST} ^(www.)?86meishi.com$
- RewriteRule ^(/)?$ meishi/index.php [L]
- ErrorDocument 401 /404.htm
- ErrorDocument 403 /404.htm
- ErrorDocument 404 /404.htm
- ErrorDocument 500 /404.htm
复制代码 DirectoryIndex default.php index.htm index.php index.html default.htm default.html index.shtml default.shtml
这个是定义默认首页的
RewriteEngine On
Options All -Indexes
php_value upload_max_filesize 20M
这个是修改程序上传文件大小的
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?lenfans.cn$
RewriteCond %{REQUEST_URI} !^/lenfans/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /lenfans/$1
RewriteCond %{HTTP_HOST} ^(www.)?lenfans.cn$
RewriteRule ^(/)?$ lenfans/index.php [L]
这个是我绑定的另外一个域名。(网站还没建好,呵呵)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?86meishi.com$ 这个是域名
RewriteCond %{REQUEST_URI} !^/meishi/ 这个是目录设置
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /meishi/$1 目录设置
RewriteCond %{HTTP_HOST} ^(www.)?86meishi.com$ 域名
RewriteRule ^(/)?$ meishi/index.php [L] 默认访问的文件,可以修改成别的
上面这个就是我绑定的www.86meishi.com的域名了,呵呵。
ErrorDocument 401 /404.htm
ErrorDocument 403 /404.htm
ErrorDocument 404 /404.htm
ErrorDocument 500 /404.htm
这些是错误文档定义。
其实.htaccess文件很强大的,可以实现很多功能,甚至可以定义php参数,比如上传文件大小,PHP程序运行时间等等,只要善于发掘,就能够实现更多的功能。 |
|
|
|
|
|
|
|
|
|
|
龙腾中原
发表于 2008-6-13 11:06:00
|
显示全部楼层
关于最后效果的演示地址:
根目录:
www.92proxy.cn
meishi子目录
http://www.86meishi.com
http://92proxy.cn/meishi |
|
|
|
|
|
|
|
|
|
|
geeks
发表于 2008-7-2 09:02:18
|
显示全部楼层
原帖由 龙腾中原 于 2008-6-13 11:06 AM 发表 
关于最后效果的演示地址:
根目录:
www.92proxy.cn
meishi子目录
http://www.86meishi.com
http://92proxy.cn/meishi
你三个网站,我没有一个能访问到。 |
|
|
|
|
|
|
|
|
|
|
活龙
发表于 2008-7-2 14:37:28
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
一路同行
发表于 2008-7-2 14:48:09
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
strategy
发表于 2008-7-19 15:17:14
|
显示全部楼层
非常好 |
|
|
|
|
|
|
|
|
|
|
boro
发表于 2008-7-23 12:45:52
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
初一
发表于 2008-7-23 19:44:49
|
显示全部楼层
看看 |
|
|
|
|
|
|
|
|
|
|
usa
发表于 2009-1-19 20:38:55
|
显示全部楼层
如果是CP控制面版,我还有方法~!
等我看到IX的再说咯~~~
其实一个独立IP建立N个站不是不可能的,现在我用的CP空间,连米都不让你多绑,但我还是在这个空间上建立了N多不同米的站 |
|
|
|
|
|
|
|
|
|
|
period2000
发表于 2009-1-19 21:04:46
|
显示全部楼层
可以访问,速度也不错啊。 |
|
|
|
|
|
|
|
|