.htaccess不能正确地redirect到www-prefixed页面
我正在尝试redirect一个url没有www。 到www.version(example.com到www.example.com)。 我使用平常 RewriteCond %{HTTP_HOST} ^example\.com [nc] RewriteRule (.*) http://www.example.com/$1 [R=301,L] 这适用于我所有的其他项目。 但是,在这个特定的网站,它以一个redirect循环结束。 这是奇怪的部分:我试图curl非www版本,以查看它使用curl –get http://example.com –dump-header domain.header > domain.html发送什么标题curl –get http://example.com –dump-header domain.header > domain.html 。 头文件看起来像这样: HTTP/1.1 301 Moved Permanently Date: Mon, 06 Jun 2011 14:45:16 GMT Server: Apache/2.2.16 (Debian) Location: http://example.com/ Vary: Accept-Encoding Content-Length: 310 Content-Type: text/html; charset=iso-8859-1 但是,生成的HTML文件是这样的: <!DOCTYPE HTML PUBLIC […]