Mod rewrite 如何将www.domain.com重写到另一个域';s/www/domain.com/index.php?

Mod rewrite 如何将www.domain.com重写到另一个域';s/www/domain.com/index.php?,mod-rewrite,Mod Rewrite,我的htaccess上当前有以下内容: RewriteEngine on RewriteCond %{REQUEST_URI} !^/www/ RewriteRule (.*) /www/$1/index.php 但我一直收到一个错误页面 我想做的是为客户注册很多域名 只需将他们网站的所有文件存储在我所在域的www文件夹中名为“theirdomain.com”的文件夹中。首先,你永远不会在URI中找到www,因为URI是index.php之后的所有内容?因此uri将是index.php?/he

我的htaccess上当前有以下内容:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule (.*) /www/$1/index.php
但我一直收到一个错误页面

我想做的是为客户注册很多域名
只需将他们网站的所有文件存储在我所在域的www文件夹中名为“theirdomain.com”的文件夹中。

首先,你永远不会在URI中找到www,因为URI是index.php之后的所有内容?因此uri将是index.php?/here/is/the.uri/string

我会看看HTTP_主机

<IfModule mod_rewrite.c>
   RewriteCond %{HTTP_HOST} !^first-host.com$ [NC]
   RewriteRule ^(.*)$ http://new-host.com/$1 [L,R=301] #Send 301 so search engines know where to go.
</IfModule>

重写cond%{HTTP_HOST}^first host.com$[NC]
重写规则^(.*)$http://new-host.com/$1[L,R=301]#发送301,让搜索引擎知道去哪里。

我不确定我是否理解你的意思。查询字符串位于?在参数列表中。foo=bar&bar=fooso例如,此htaccess位于www.mydomain.com上的域。我们有人注册为someone.com并将其dns转发到www.mydomain.com,现在htaccess应该指向mydomain.com/www/someone.com/index.php,这可能吗?我非常怀疑这可能通过htaccess实现,您需要在服务器上设置dns记录以指向特定用户,因此theredomain.com将指向/server/domains/theredomain.com/public\u html/im在服务器和dns方面不是最好的,但我相信这样的方法是需要的