【问题标题】:prestashop multiple domains for same shopprestashop 同一商店的多个域
【发布时间】:2017-08-19 20:46:29
【问题描述】:

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

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

我也有域名example.net,我想开同一家店,如果我将example.net指向同一个位置,url将从example.net变为example.com

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

这有可能吗?

【问题讨论】:

    标签: prestashop multiple-domains


    【解决方案1】:

    例如,使用 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 功能(在后台,在 Preferences > General,在页面底部)并指向多个地址,它仍然是同一家商店并且工作相同。 这更简单!

    【讨论】:

    • 不要犹豫,在任何有关 HTTPS 的行中添加 #。这是可选的。
    猜你喜欢
    • 2015-12-24
    • 1970-01-01
    • 1970-01-01
    • 2015-10-16
    • 2015-12-04
    • 2015-07-04
    • 1970-01-01
    • 2015-06-01
    • 1970-01-01
    相关资源
    最近更新 更多