0

I have a multivendor eCommerce site. for example, mainsite.com. where vendor shop URL is mainsite.com/s/shopname. I want to give vendors to add a custom domain pointing to their shop. How can I create this type of functionality on my site?

This feature is similar to adding a custom domain to sites (Google sites, Heroku, Wix, Github, etc..)

  • Your software which runs multi-vendor eCommerce site must support mapping domain names to specific store. So, solution will depend on software used, you may need to mention that to get better response – Andrei Filonov Feb 17 '21 at 05:00
  • The multivendor eCommerce site is created using Laravel 7.x (PHP 7.4). I want to develop this functionality for this site. How to do mapping domain names to a specific store – Documents Feb 17 '21 at 06:06
  • Any solution with .htaccess, apache/Nginx config, DNS zone will be appreciated. – Documents Feb 17 '21 at 06:09
  • A distributed configuration file (".htaccess") cannot somehow magically make up domain names or host names. You need to define those else where, take care that those host names have a DNS resolution pointing to your http server and that your http server actually responds to those. So all that is out of scope here. And for the last bit, the mapping of requested host names to a URL path, you will find hundreds of existing answers here on SO describing exactly that... – arkascha Feb 17 '21 at 06:54
  • Can you please give a link to an existing answer for creating this type of functionality? – Documents Feb 17 '21 at 09:52
  • In your Laravel code you need to have a map of domain names and stores they are assigned to. Then you check $_SERVER['HTTP_HOST'] somewhere early in the code and pull the store it refers to. That's a general direction, but that's as good as it gets I think... – Andrei Filonov Feb 17 '21 at 15:56

0 Answers0