Forum Moderators: phranque
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www.example.com
RewriteRule ^(.*)$ [example.com...] [R=permanent,L]
The issue is that this produces an unexpected slash. Here's a sample request:
[example.com...]
GET /test HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 301 Moved Permanently
Date: Sun, 26 Sep 2004 00:24:11 GMT
Server: Apache
Location: [example.com...]
Content-Length: 236
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
----------------------------------------------------------
As you can see if I request [example.com...] I get redirected to [example.com...] <- which has an extra slash after the domain name.
If anyone has ideas how to fix, I would be most appreciative.