样品#1(按预期工作):的.htaccess的mod_rewrite重定向
RewriteCond %{HTTP_HOST} ^www.hanoichurch.com$ [OR]
RewriteCond %{HTTP_HOST} ^hicvn.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.hicvn.com$ [OR]
RewriteCond %{HTTP_HOST} ^hicvn.org$ [OR]
RewriteCond %{HTTP_HOST} ^www.hicvn.org$ [OR]
RewriteCond %{HTTP_HOST} ^hanoiworship.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.hanoiworship.com$
RewriteCond %{REQUEST_FILENAME} !^google
RewriteRule ^/?(.*)$ "http\:\/\/hanoichurch\.com\/$1" [R=301,L]
样品#2(不起作用*):
RewriteCond %{HTTP_HOST} ^www.nathanbrauer.com$ [OR]
RewriteCond %{HTTP_HOST} ^nathanbrauer.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nathanjbrauer.com$
RewriteCond %{REQUEST_FILENAME} !^google
RewriteRule ^/?(.*)$ "http\:\/\/nathanjbrauer\.com\/$1" [R=301,L]
*失败默默(访问www.nathanbrauer.com只需加载页面,不会重定向到nathanjbrauer.com)。
万分感谢!
===更新===
我最终什么事就是用这个代码做:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^nathanjbrauer\.com$
RewriteCond %{REQUEST_FILENAME} !^google
RewriteRule^http://nathanjbrauer.com%{REQUEST_URI} [R=301,L]
请原谅我的矮小。我认为每个人和他们的母亲都会在这里看到.htaccess问题,所以我想我会保持简短:) – 2012-02-01 08:17:36
此外,访问这些网站以测试自己可能无法正常工作,因为我只是更改了名称服务器,因此可能需要一些时间DNS已经传播。 – 2012-02-01 08:18:56