how do i redirect my domain to www. so when someone types mydomain.com i want it to redirect to www.mydomaincom also my sites script is working of my server name i want it to work on my real domain name
If you've installed Google Webmaster Tools, you can go in and set your preferred domain. Then Google will redirect all queries to your preferred version.
something like this in PHP header("Location: http://www.whatever.com/{$_SERVER['REQUEST_URI']}"); I would use mod rewrite over PHP though
You guys are crazy xD Just use this in .htaccess RewriteCond %{HTTP_HOST} ^YOURDOMAIN.COM$ RewriteRule ^(.*)$ "http\:\/\/www\.yourdomain\.com\/$1" [R=301,L] Code (markup):
use htaccess is a perfect option. Use Chuckun code and change your website name instead of YOURDOMAIN.com
lol they just wanted to do it the more complicated way. I guess some people like making 3 left turns to go right. If you have cpanel, you can just go to the redirects section too.