prestashop同一商店的多个域名

问题描述:

我有一个prestashop实例,我希望能够使用多个域来访问它。prestashop同一商店的多个域名

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

我也有域example.net,我想开家店里,如果我点example.net同一位置时,URL从example.net改为example.com

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

这是可能以某种方式?

例如使用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功能做到这一点(在后台,在首选项>常规,在页面的底部)并指向多个地址,它仍然是同一家商店,工作原理相同。 这样更简单!

+0

请不要犹豫,在有关HTTPS的任何行添加#。这是唯一的。 –