开发者

Multiple domains in Drupal

开发者 https://www.devze.com 2023-02-10 15:41 出处:网络
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.

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?


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


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!


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消