#在httpd.conf中添加或在网站根目录下的.htaccess文件中添加
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{SERVER_NAME} ^xxx.com [NC]
RewriteRule ^(.*)$ http://www.xxx.com/$1 [R=301,L]
</IfModule>