[求助].htaccess Rewrite能人请进
|
|
我已经按网上的教程,将我的域名 www.52gf.net Rewrite 到子目录 /52bf 中去了,
我还想要将 itjoy.net 的任意子域名(即 *.itjoy.net) Rewrite 到 /wpmu 中去,
该如何写 .htaccess 呢?
---已经做了泛域名解析 *.itjoy.net 到我的IP,测试过*.itjoy.net都可以访问到/www中的文件。
以上都是为了做WORDPRESS MU站,不行的话我只有用子目录模式了,谢谢啦!
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?52gf.net$
# Change ’subfolder’ to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/52bf/
# Don’t change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change ’subfolder’ to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /52bf/$1
# Change yourdomain.com to be your main domain again.
# Change ’subfolder’ to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?52gf.net$
RewriteRule ^(/)?$ 52bf/index.php [L] |
|
|
|
|
|
|
|
|
|
|
小野大神
发表于 2008-9-5 13:35:53
|
显示全部楼层
把RewriteCond %{HTTP_HOST} ^(www.)?52gf.net$这句替换为下面的:
RewriteCond %{HTTP_HOST} ^(.*\.)?52gf.net$ |
评分
-
查看全部评分
|
|
|
|
|
|
|
|
|
|
itjoy
发表于 2008-9-5 18:23:02
|
显示全部楼层
哇哈哈,成功啦,楼上多谢啦,
参考楼上的然后又胡乱试,终于成了,
我在原来.htaccess 后面加上了:
RewriteCond %{HTTP_HOST} ^(.*\.)?itjoy.net$
RewriteCond %{REQUEST_URI} !^/wpmu/
RewriteRule ^(.*)$ /wpmu/$1
我的 *.itjoy.net 就全跑 /wpmu/ 目录去啦!
wordpress mu 开张啦,大家来试试!
http://itjoy.net
支持子域名 http://*.itjoy.net |
|
|
|
|
|
|
|
|
|
|
zxq1972
发表于 2008-10-1 01:01:08
|
显示全部楼层
有请 itjoy 进来看一下
看到你泛域名成功了,我非常的羡慕,请告知如何实现的呀,我按照你的方法还是没有成功,
问题1:你是独立IP吗?
问题2:域名的解析:
我是国内的域名支持泛域名解析的,修改DNS到LP后,好像变成不支持泛域名解析了,因为我随便ping 一个二级域名都得不到ip地址
我非常的痛苦,请你帮忙! |
|
|
|
|
|
|
|
|
|
|
zkzl822
发表于 2008-10-1 19:35:49
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
大漠孤狼
发表于 2008-10-2 09:52:52
|
显示全部楼层
|
cpanel面板可以泛绑定,添加一个*的二级域名就可以 |
|
|
|
|
|
|
|
|
|
|
lixi
发表于 2008-10-2 15:41:18
|
显示全部楼层
原帖由 大漠孤狼 于 2008-10-2 09:52 AM 发表 
cpanel面板可以泛绑定,添加一个*的二级域名就可以
大漠,泛绑定只能是2级么?我试过3级的泛绑定不行。有没有什么办法? |
|
|
|
|
|
|
|
|
|
|
zxq1972
发表于 2008-10-3 09:45:52
|
显示全部楼层
原帖由 大漠孤狼 于 2008-10-2 09:52 AM 发表 
cpanel面板可以泛绑定,添加一个*的二级域名就可以
大漠真的可以吗?
好像不行,我用cpanel面板 subdomain add *,然后会在根目录下产生*的文件夹,是否向这个文件夹上传文件,然后所有的二级域名都可以被访问到这个文件夹,那么我其他通过 subdomain 添加的域名是否还是有效的呢?根据我的实际操作,其他的不会受到影响,也就是说其他添加的二级域名是独占的.
但是官方给我的回复是这样:
Hello,
To clarify, are you trying to add EXACTLY *. 888108.com ?
Please note, that this would not be a valid use for subdomains, as subdomains need to use alphanumeric characters.
Best regards,
Troy Laclaire support@lunarpages.com Support Forums - http://www.lunarforums.com Phone: 1-714-521-8150
Phone: 1-714-521-8150 (International)
24 hour Network Status Line: 1-562-697-8106
意思就是说,* 不是一个有效的子域名,有效的子域名应该是数字或者字母. |
|
|
|
|
|
|
|
|