2017-03-27 116 views
2

我有一個prestashop實例,我希望能夠使用多個域來訪問它。prestashop同一商店的多個域名

假設我的域名是example.com,並且我設置了prestashop主域名爲example.com。

我也有域example.net,我想開家店裏,如果我點example.net同一位置時,URL從example.net改爲example.com

我想有兩個域沒有url更改,但我也不想使用多個商店(prestashop multistore功能,因爲它將是完全相同的商店)。

這是可能以某種方式?

回答

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功能做到這一點(在後臺,在首選項>常規,在頁面的底部)並指向多個地址,它仍然是同一家商店,工作原理相同。 這樣更簡單!

+0

請不要猶豫,在有關HTTPS的任何行添加#。這是唯一的。 –

相關問題