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

www.sportsitems.com/products
www.cloths.com/products

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,

cheers,
Sameera

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.

Hi Max,

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

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

www.site1.com

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

so following scenarios are ok,

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

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

But my problem is , in both the cases
request.host is always www.site1.com

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

thanks in advance

cheers
sameera

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.