I want to create a site like shopfy, where I can hosted it in a central
place merchants can create their own stores, But I want the following
functionalities to happen,
I should be able to give each merchant a different url, like
1 - www.sportsitems.com , www.cloths.com etc…
2 - when they access the site their URL should be changed accordingly,
Ex: if sportsitems user and cloths user is accessing their product
page it should be like
We have a similar system in our website, which is a ‘white label’ site
which is branded for each of our clients, which are called
‘music_services’ in our system. The branding is pretty minimal - each
music service has their own version of some of the graphics that we use
on the site (eg some logo gifs) and they also have a url string stored
in the database as ‘host’.
The main difference between the different sites is the pre sign-in page,
which differs from music service to music service and effectively
advertises that site. These are all just wordpress pages (meaning they
can be edited and changed without having to restart the server or
anything). So, the home page directs to the wordpress page if you’re
not logged in, then when you log in you go to the site’s home page,
which is the same for all music services except for the different logos.
Each user is associated with a particular music service, and when they
log in we show the relevant graphics for their music service: whichever
url they happen to be at. So, you can access the site from any of the
urls. However, you could instead just get the url with request.host (or
whatever it is) and decide which branding you want to use based on that.
So, anyway, it’s not hard to do but takes a little bit of planning.
request.host (or maybe request.host_with_port) returns the referrer url,
ie the url that the browser asked for. So, it should be the same as
what is in the address bar in the browser.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.