Creating a Shopfy kind of a website - pls help

Hi All,

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 - , 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

I’m hoping the give each site an id so that I can identify the request
from each site and cater accordingly…

So please help me and guide me if you think I’m going in a wrong
direction :smiley:

thanks in advance,


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 (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.

Hi Max,

I tried and had no luck, here’s what i did

I hosted my rails app in under the url (I publicly hosted)

and had another domain and I forwarded it to (with masking, so that even if the user is in his url will say

so following scenarios are ok,

if user type he/she will go there and in the URL it
displays as

if a user type www… (which is redirected with masking) he/she
will ended up in , but the URL says

But my problem is , in both the cases is always

A’m I doing something wrong here or what is the best way to do this,

thanks in advance

sameera (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.