Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2 domains for one shop


nudylady

Recommended Posts

I setup OSC in domainA

 

There is index.php file in {home}/html/ directory.

the content is

<?php

header("Location: http://www.domainA.com/catalog/index.php")

?>

 

 

Then I added domainB under root directiry.

 

Now I have 2 domains parked in {home}/html/ directory in the hosting company

 

I can browse both www.domainA.com/catalog/index.php and www.domainB.com/catalog/index.php. The 2 domains that share the same root directory displayed the same content and displayed with different URLs in address bar.

 

but if I click something on www.domainB.com/catalog/index.php it, then adress bar goes to www.domainA.com/catalog/xxxxxx

 

I dont want people to see domainA if they come from DomainB. how to display www.domainB.com/catalog/xxxxxx all the time?

Link to comment
Share on other sites

but if I click something on www.domainB.com/catalog/index.php it, then adress bar goes to www.domainA.com/catalog/xxxxxx

 

I dont want people to see domainA if they come from DomainB. how to display www.domainB.com/catalog/xxxxxx all the time?

 

i think this is happening because in your configure.php file, your HTTP_SERVER is defined as domainA.com. so when domainB is building the links on the page, it creates them with domainA.com's information.

 

i'm not guaranteeing this will work, but...you might try changing configure.php to use the php $_SERVER['SERVER_NAME'] to define it. like:

define('HTTP_SERVER', 'http://' . $_SERVER['SERVER_NAME']);

 

this assumes that $_SERVER['SERVER_NAME'] is being properly filled in. you might try running a couple of test scripts to ensure that the value is correct before you go changing configure.php and crashing your site. :blush:

 

of course, i haven't tested this -- it's just off the top of my head, so all the standard disclaimers apply!

Link to comment
Share on other sites

my site just crashed. I moved out configure.php for back up.

Move the file back. it crashed. strange?

 

when you say your site crashed, do you mean that after making the change i suggested that it crashed? i was suggesting that you write a test script to see what the exact behavior of using the $_SERVER value would be. did you do any testing?

 

also, when you say 'it crashed' - that doesn't tell me a lot. what is the behavior your saw? it had to do something. give me a little to go on and i might be able to point you in the right direction. but please, test this out first in a separate script so you don't make your site unusable in the mean time.

Link to comment
Share on other sites

when you say your site crashed, do you mean that after making the change i suggested that it crashed? i was suggesting that you write a test script to see what the exact behavior of using the $_SERVER value would be. did you do any testing?

 

thank you for help

 

I dont understand $_SERVER at all. yesterday I played arround with configure.php. site crashed. I tried to fix the file but I cannot.

I moved install fold into my root and did installation again. It's all OK now. All contributions are still there.

 

2 domains for one shop maybe too hard for me to do.

Link to comment
Share on other sites

i'm not guaranteeing this will work, but...you might try changing configure.php to use the php $_SERVER['SERVER_NAME'] to define it. like:

define('HTTP_SERVER', 'http://' . $_SERVER['SERVER_NAME']);

 

of course, i haven't tested this -- it's just off the top of my head, so all the standard disclaimers apply!

 

 

I tested your code. Apart from seo HTML URL module it workded well. My whole site stayed at domainB.

 

But I just realised things are more complicated than I thought. When customer sign up at domainB. he will get a welcome email from DomainA.

Also website tag-the blue title on IE. I am nearly give up.

Link to comment
Share on other sites

I tested your code. Apart from seo HTML URL module it workded well. My whole site stayed at domainB.

 

But I just realised things are more complicated than I thought. When customer sign up at domainB. he will get a welcome email from DomainA.

Also website tag-the blue title on IE. I am nearly give up.

 

yeah...the email information is coming from the database and both domains are using the same database. so getting that to work would be quite a bit more involved. it can be done, but it won't be easy. you have to make code changes so that whenever you fetch this data from the database you use different data, depending on the domain in use. the use of this data is spread throughout the code, so it would require changes to numerous areas. very tedious. but it is doable if you really want to take the time. :blink:

Link to comment
Share on other sites

  • 2 weeks later...

thanks.....email is too hard for me.

one more thing anyone knows: how to make a customer login at the 2 sites at the same time.

when he login at siteA. then he opens a new brower for siteB and showing he logged on siteB already.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...