I build and set up websites, and I was asked by my client if I can make "http://domain.com" forward directly to the "http://www.domain.com" How can I do this? I keep thinking its in the DNS control, but I'm not sure. I use GoDaddy btw. Because I have absolutly no idea where in the process of publishing to do this, this message may be in the wrong board.
Use Mata Refresh: <META HTTP-EQUIV="REFRESH" CONTENT="X;URL=yourpage.html">. X= seconds delay before refresh, I always use 0 Your will have refresh to www.domain.com/welcome.html or something
The most efficient way is to setup a CNAME record in your DNS. However, with Apache's standard configuration, the user would see the URL in the browser as they entered it. To get Apache to actually change the URL to the new one in the browser, use a Redirect.
If you are using Apache, try modifying your .htaccess file; RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] Code (markup): If you are using lighttpd, try this in your lighttpd.conf; $HTTP["host"] =~ "^example\.com$" { url.redirect = ( "^/(.*)" => "http://www.example.com/$1" ) } Code (markup): Or, alternatively, you may use PHP. Edit (or create) your index.php; <?php if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.'.$_SERVER['HTTP_HOST'] .$_SERVER['REQUEST_URI']); } ?> Code (markup):