我正在寻找一种方式来整个网站重定向到一个单独的域。我想在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不存在,这就是为什么整个事情失败 –