我正在尋找一種方式來整個網站重定向到一個單獨的域。我想在httpd.conf文件中執行此操作。例如VirtualHost我看起來像:重定向所有URL到一個頁面在httpd.conf
<VirtualHost xx.xx.xx.xx>
ServerName website.com
ServerAdmin [email protected]
ScriptAlias /cgi-bin/ /usr/local/apache2/htdocs/cgi-bin/
DocumentRoot /usr/local/apache2/htdocs/website
CustomLog logs/website/access_log combined
ErrorLog logs/website/error_log
Redirect/http://newwebiste.com
Redirect /xxx http://newwebiste.com
</VirtualHost>
目前上面的重定向仍然保留完整的URL。
所以,如果我想http://webiste.com/test/thispage.html我會重定向到http://newwebsite.com/test/thispage.html。我只是想讓它去到newwebsite.com並失去其餘的。
所以..
http://webiste.com/test/thispage.html
到
什麼我需要添加到httpd.conf來實現這一目標?
感謝,
重新啓動httpd服務時,我收到無效的命令警告。請參閱下面的 –
/usr/local/apache2/conf/httpd.conf中第1526行的語法錯誤: 無效的命令'RewriteRule',可能是拼寫錯誤或未包含在服務器配置中的模塊定義 –
我認爲apache服務器需要被更新。重寫MOD不存在,這就是爲什麼整個事情失敗 –