prestashop同一商店的多个域名

时间:2017-03-27 08:29:05

标签: prestashop multiple-domains

我有一个prestashop实例,我希望能够使用多个域访问它。

假设我的域名是example.com,我将prestashop主域名设置为example.com。

我也有域example.net,我想打开同一个商店,如果我将example.net指向同一位置,则url将从example.net更改为example.com

我希望两个域都没有更改网址,但我也不想使用多个商店(prestashop多商店功能,因为它将是完全相同的商店)。

这有可能吗?

1 个答案:

答案 0 :(得分:0)

例如,使用Nginx(或Apache)创建反向代理可以是另一种方法。

以下是Nginx上这样一个域的示例配置:

server {
   listen *:443 ssl;
   listen *:80;
   ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
   server_name domain.tld domain2.tld domain3.tld;

   access_log /var/log/nginx/domain.tld.access.log;
   error_log /var/log/nginx/domain.tld.error.log;

   root /srv/domain.tld/;
   index index.html index.htm index.php;

   location  / {

      proxy_pass http://prestashopdomain.tld;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header HTTPS   $https;

   }

}

很抱歉这样做,但你可以通过Multishop功能(在后台,在首选项>一般,在页面底部)和点多个地址实现这一点,它仍然是同一个商店和工作相同。 这样更简单!