Re: Redirect www.mydomain.com to mydomain.com
This should work (Boss turned it around and added some useless code to it) :
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yoursite.com$
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=permanent, L]
And yes, you can replace "yoursite.com" with your actual domain.
Edit: about your www.xyz.com to zyz.com, are you sure that's not a typo? Either way, if you replace the "www.yoursite.com" with "www.xyz.com" and the second "yoursite.com" to "zyz.com" it should work.
Last edited by marshian; 02-01-2010 at 06:07 AM.
Real programmers don't document their code - if it was hard to write, it should be hard to understand.