You are here:  » differen turl but same site


differen turl but same site

Submitted by paullas on Tue, 2020-12-01 09:10 in

Hi David.

I am wondering if you can help, is there a way i can for example park a domain name at example.net and that domain name stays in the address bar, if yes then once i park a domain name how do i get that name to show specific products on the home page. For example if i park the domain name example.net at example.com the the url example.net stays in the address bar and it display Christmas jumpers as the featured products. same if i park example.org then that domain name stays in the address bar and displays christmas mugs on the featured home page.

this way example.com can me the main website with all the products in.

Many thanks

Paul

Submitted by support on Wed, 2020-12-02 08:36

Hi Paul,

What you could do is set up your different featured products using the Multiple Featured Products Sections mod and then use $_SERVER["HTTP_HOST"] to decide which section to display on the home page, for example:

<?php
switch($_SERVER["HTTP_HOST"])
{
  case 
"example.net":
      
$featuredSection["section"] = "jumpers";
      require(
"featuredSection.php");
    break;
  case 
"example.org":
      
$featuredSection["section"] = "mugs";
      require(
"featuredSection.php");
    break;
}
?>

(don't forget to include www. in the host names if that is how your hosting is setup...)

Cheers,
David.
--
PriceTapestry.com