Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12
  1. #11
    Join Date
    Mar 2008
    Location
    Ontario
    Posts
    39
    Plugin Contributions
    0

    Default Re: Starts with wrong domain host name

    ////////// snip from application_top.php
    Code:
    /**
     * if main configure file doesn't contain valid info (ie: is dummy or doesn't match filestructure, display assistance page to suggest running the installer)
     */
    if (!defined('DIR_FS_CATALOG') || !is_dir(DIR_FS_CATALOG.'/includes/classes')) {
      require('includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
      exit;
    }
    
    /**
     * 
    Check requested domain name matches Zen Cart config.  Compliments of meshgraphics.com.
     */
    
    if (!defined('HTTP_SERVER') || 'http://'. $_SERVER['SERVER_NAME'] != HTTP_SERVER){
      require('includes/templates/template_default/templates/tpl_zc_install_suggested_default.php');
      exit;
    }

  2. #12
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Starts with wrong domain host name

    Quote Originally Posted by meshgraphics View Post
    If by mistake you had the same DocumentRoot for both websites, asking for either website would start the same index.php.

    In fact, this may be what you want. If you want multiple domain names starting up the same site, this is what you would do.
    Exactly right. Different domain names coming to the same front controller (index.php) may be a mistake, though it's more likely to be deliberate. For example I have clients who run two or more sites from the same Zen Cart. Some run multiple retail sites using the same products, one runs a retail and a wholesale site with a common sign on but different products and pricing depending on which domain the customer comes in on (and whether they are authorised for the wholesale site).
    Quote Originally Posted by meshgraphics View Post
    Ok, lets suppose Zen Cart is going to check the servername after the php starts up. Apparently, is doesnt do that.
    Also correct. If you choose to direct multiple domains at a single front controller, Zen Cart has to assume that you did it deliberately, so there's no corrective or specific action for it to take, and so no reason to perform the check.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Changing domain to another name within same host
    By jackryan in forum Installing on a Linux/Unix Server
    Replies: 6
    Last Post: 3 Dec 2009, 04:52 PM
  2. Wouldn't install on my paid domain name - shop works but wrong URLs
    By ningyotan in forum Installing on a Windows Server
    Replies: 7
    Last Post: 14 Nov 2009, 04:24 AM
  3. Replies: 3
    Last Post: 20 Mar 2009, 06:11 AM
  4. moving zen cart to a virtual host with no domain
    By Capslock118 in forum General Questions
    Replies: 4
    Last Post: 26 Jun 2007, 09:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg