Redirect domain.com to www.domain.com?

macconnect

Verified User
Joined
Jan 8, 2007
Messages
17
We have a customer that wants all requests to domain.com to be redirected to www.domain.com. How can this be configured via DA? The site redirection interface does not seem suited to handle this particular situation.

It looks like something we'll have to configure for him manually, but I figured I'd check just in case I missed something.
 
By default the site works fine with or without the "www". What he wants is an actual redirect so that even if you type "domain.com" you get redirected to "www.domain.com". DA does not appear to do that by default.
 
By default the site works fine with or without the "www". What he wants is an actual redirect so that even if you type "domain.com" you get redirected to "www.domain.com". DA does not appear to do that by default.

.htaccess
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]

HTH,
Rick
 
Yeah, we can do that. I was just hoping to have a way for the client to set it up it himself without having to manually edit config files (about which he has no clue).

Thanks anyway for the feedback.
 
Go to the User Level for that user and then click on Site Redirection under Advanced Features. Fill it in like this:

Local URL Path domain.com: /
Redirect Type: 301 Permanent
Destination URL: http://www.domain.com

Then click Save to add it. This should probably work as well.
 
No, elaine, it won't All setting a cname does in your example is require two DNS lookups, one for www and one for just the domain. In the end it will return only the IP#, just as an A record would.

Jeremy's reply should work.

Jeff
 
Sounds like he may be doing as suggested above, redirect domain.com to www.domain.com and since they are basically the same thing then yes its a loop. The redirect works by using a .htaccess file in the public_html directory of the domain. Since domain.com and www.domain.com point to the same directory then it will be an endless loop. You don't want to redirect a domain to itself.
 
Back
Top