2010-06-30 69 views
-1

我有這個在我的htaccess目前:如何將www.domain.com重寫爲其他域的/www/domain.com/index.php?

RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/www/ 
RewriteRule (.*) /www/$1/index.php 

,但我不斷收到一個錯誤頁面

什麼即時試圖做的就是註冊了很多域名,爲客戶 ,只是將其所有的網站我的域名www文件夾中名爲「theirdomain.com」的文件夾中的文件。

回答

0

首先你永遠不會在URI中找到www,因爲URI是index.php之後的所有東西?所以uri會是index.php? /here/is/the.uri/string

我想看看HTTP_HOST

<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> 
+0

林不知道我理解你。查詢字符串跟在?在參數列表中。 foo = bar&bar = foo – RobertPitt 2010-06-30 06:52:59

+0

所以例如這個htaccess的域名是www.mydomain.com。 我們有人註冊爲someone.com並將他們的DNS轉發到www.mydomain.com, 現在htaccess應該指向mydomain.com/www/someone.com/index.php 是可能的嗎? – lock 2010-06-30 07:39:01

+0

我非常懷疑這是可能的通過htaccess,你需要設置你的服務器上的DNS記錄指向一個perticular用戶,所以theredomain.com將指向/server/domains/theredomain.com/public_html/我不是最好在服務器和DNS,但我相信這樣的方法是需要的 – RobertPitt 2010-06-30 08:01:45

相關問題