年年我发



返回   年年我发 > 网站建设 > 建站交流
用户名
密码
 
注册账号 论坛帮助 会员列表 日历事件网赚工具 标记版面已读

建站交流 讨论网站建设的基本方法、技巧、空间问题讨论、域名交流、
资源分享、技术交流,站长们经常进来看看噢!
注意:不要留下你的网站链接!

回复
 
主题工具 搜索本主题 显示模式
  #1   IP: 222.184.115.77
旧 2007-08-18, 01:25 AM
smiling smiling 当前离线
高级会员
 
注册日期: 2006-02-12
帖子: 528
现金: 3821 元
资产: 3821 元
声望: 10 smiling 正向着好的方向发展
默认 mapping multiple domains into the filespace of a single domain

There is simply no reason to expose the subdirectories, *and* it makes the URLs ugly, so don't do a redirect. Use an internal rewrite instead. It's very simple code, and nothing to be concerned with SEO-wise.

Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{HTTP_HOST} ^(www\.)?domainA\.com [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteCond $1!^domainA/
RewriteRule (.*) /domainA/$1 [L]
#
RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.com
RewriteCond $1!^domainB/
RewriteRule (.*) /domainB/$1 [L]

Each domain is rewritten to its own subdirectory, unless the request has already been rewritten to the subdirectory (mod_rewrite in .htaccess appears to be recursive, so testing for this case is necessary if the code is in .htaccess, but not if it's in httpd.conf).
Search engines and visitors will be entirely unaware that two sites are hosted under the same account, unless they investigate the domain registrations and DNS records; the rewrite process itself is entirely transparent.

You can move everything, including a robots.txt file for each domain, into its own subdirectory; the only file needed in the home directory is this .htaccess file.

True HTTP/1.0 clients do not provide a host header. For this reason, a default rewrite (to domainA) is provided above. While many clients advertise that they are HTTP/1.0, most have been modified to send the host header, since otherwise they cannot access any sites that are hosted on name-based virtual servers (Name-based servers depend on the HTTP host header to figure out which of the many sites at the same IP address to serve).

Since you've set up the DNS, the only concern is whether your server is set up to accept both domain names and send requests for them to your document root ('home' directory). If that's taken care of, then adding the above rules to your existing .htaccess file should do what you need.
回复时引用此帖

wellcome to www.0058.net
回复


当前查看此主题的会员: 2 (0 位会员和 2 位游客)
 
主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

论坛启用 BB 代码
论坛禁用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码
论坛跳转

相似的主题
主题 主题作者 版面 回复 最后发表
Volume! What to do about domains? sunshine Google Adsense 0 2006-12-11 09:41 AM


所有时间均为北京时间. 现在的时间是 09:54 PM, Free Patent & Patent Ideas


Powered by vBulletin 3.5.2 Chinese Exhibition Happy New Year
©2000 - 2008,Jelsoft Enterprises Ltd  Desiccant Molecular Sieve Weight Loss Bentonite Trade Manager