Multiple domains in Drupal

1.5k views Asked by At

I have a Drupal website. It's domain is example.com. I want domains: mysite.com and mywebsite.com to point to example.com website. How to setup multiple domains that point to one website?

3

There are 3 answers

0
Kevin On BEST ANSWER

You can add ServerAlias to your Apache conf for that virtual host. That is one way. You could also forward the domains with DNS.

0
eXoSaX On

I used 301 redirect in .htaccess. I added thes two lines to .htaccess file in Drupal root:

RewriteCond %{HTTP_HOST} ^www\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Now www.mysite.com goes to www.example.com I also added Domain Aliases in Plesk Panel.

Thanks a lot!

1
Tyler Eaves On

DomainAccess module is your friend here. While it's probably overkill in this case, it'll be there for you if you ever want to specialize (like change the title or theme based on what domain you're on).