Hi there,
Quote:
Originally Posted by moyorakkhi
I'm using the following rewrite rule to redirect domain.com to www.domain.com in apache.
|
are you attached to that company in any way? If not, please don't use domain names you don't own as arbitrary examples. That's why the example domains like example.com, example.net or example.org have been invented (see
RFC 2606 for more details).
Quote:
Originally Posted by moyorakkhi
Code:
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
Problem is, after redirecting to www.domain.com it's adding an extra "/". So it's like "http://www.domain.com//".
|
Yes, because that's what your rule demands:
It says "Take 'http://www.domain.com/' and append the contents of $1".
And $1 contains the local part of the HTTP URL, which always begins with a slash - in this case just '/' for the root document. Leave the trailing slash in your RewriteRule away.
[X] Doc CPU