2013-03-26 30 views
-1

我有一個名爲video.php文件在我的域名,但希望它在我的子域。強制php文件到子域

現在它像www.domain.com/video.php?id=parameter&fewotherparamer=1233

,我想將其更改爲

video.domain.com/video.php?id=parameter&fewotherparamer=1233 

怎麼可能呢?我已經試着在這裏找到使用谷歌和搜索功能,但沒有找到重點。

感謝

回答

2

添加這些指令的.htaccess在domain.com根目錄(或虛擬主機配置)文件,並確保您啓用了mod_rewrite模塊

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^(www\.)?domain.com$ [NC] 
RewriteRule ^video.php$ http://video.domain.com/video.php [R=301,NC,L ]