3

I have a prestashop instance and I want to be able to access it using multiple domains.

Lets say my domain is example.com and I've set prestashop main domain to be example.com.

I also have the domain example.net and I want to open the same shop, if I point example.net to the same location, the url will change from example.net to example.com

I want to have both domains without the url to change but I also don't want to use multiple shop(prestashop multistore functionality because it will be the exact same shop).

Is this possible somehow?

Stefan Flondor
  • 359
  • 1
  • 6
  • 13

1 Answers1

1

Creating a reverse proxy using Nginx (or Apache) for example can be another way to make this.

Here is a sample configuration for such one domain on 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;

   }

}

Sorry to says this but you can achieve this via Multishop Function (in backoffice, in Preferences > General, at the bottom of the page) and point multiple address, it will still be the same shop and work the same. This is way simpler !

Matt Loye
  • 1,301
  • 2
  • 11
  • 14