View Single Post
Old 10-29-2012, 06:47 PM   PM User | #2
patryk
Regular Coder

 
patryk's Avatar
 
Join Date: Oct 2012
Location: /dev/couch
Posts: 395
Thanks: 2
Thanked 64 Times in 64 Posts
patryk is on a distinguished road
can you set up another vhost on your server?
if so, set up one for mydomain.com, second for www.mydomain.com and in root directory of domain.com place .htaccess with this:
Code:
Redirect 301 / http://www.mydomain.com
---edit---

without second vhost:
in .htaccess:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [nc]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

Last edited by patryk; 10-29-2012 at 07:10 PM..
patryk is offline   Reply With Quote
Users who have thanked patryk for this post:
ajhauser (10-29-2012)