Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Feb 2014
    Posts
    10
    Plugin Contributions
    0

    Default redirecting a domain to subdomain - help needed

    hi

    i have bought a new domain and i want it to point to my zencart store which is installed on a subdomain. i have already added the redirect through cpanel and also edited the part of the configure.php file:

    define('HTTP_SERVER', 'http://www.mydomain.com');
    define('HTTPS_SERVER', 'https://www.mydomain.com');

    it redirects to the subdomain but the subdomain is still showing in the web address bar.

    i didn't have this problem on my old store which was with another host and it was zen cart v1.39, i now have a new host and zen cart v1.51.

    any help would be appreciated.

    thanks

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by yanxin View Post
    hi

    i have bought a new domain and i want it to point to my zencart store which is installed on a subdomain. i have already added the redirect through cpanel and also edited the part of the configure.php file:

    define('HTTP_SERVER', 'http://www.mydomain.com');
    define('HTTPS_SERVER', 'https://www.mydomain.com');

    it redirects to the subdomain but the subdomain is still showing in the web address bar.

    i didn't have this problem on my old store which was with another host and it was zen cart v1.39, i now have a new host and zen cart v1.51.

    any help would be appreciated.

    thanks
    You need in your includes/configure.php and "admin"/includes/configure.php to change the
    DIR_WS_CATALOG
    and
    DIR_WS_HTTPS_CATALOG

    From /your_sub_domain/
    To /

    That will correct the redirect(s).
    This will leave behind a single forward slash between the two single quotes.

    This is only to be done in the two places of the two described files, do not remove it from elsewhere in the files.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2014
    Posts
    10
    Plugin Contributions
    0

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by mc12345678 View Post
    You need in your includes/configure.php and "admin"/includes/configure.php to change the
    DIR_WS_CATALOG
    and
    DIR_WS_HTTPS_CATALOG

    From /your_sub_domain/
    To /

    That will correct the redirect(s).
    This will leave behind a single forward slash between the two single quotes.

    This is only to be done in the two places of the two described files, do not remove it from elsewhere in the files.



    hi

    i went to follow your steps but it seems like it is already like that by default, check below-

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
    // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

  4. #4
    Join Date
    Feb 2014
    Posts
    10
    Plugin Contributions
    0

    Default Re: redirecting a domain to subdomain - help needed

    hello, i went to do what you said, but it seems like it is already like that, see below:

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
    // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by yanxin View Post
    hello, i went to do what you said, but it seems like it is already like that, see below:

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
    // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    With HTTP_SERVER', 'http://www.mydomain.com' and the above, the store should appear as 'http://www.mydomain.com

    Assuming that the cPanel actions were performed properly to point to the subdirectory that contains your store when http://www.mydomain.com is entered. Off the top of my head I do not know what it would take to have that action occur, but it appears to be an issue with setting up the cPanel portion.

    Haven't described a problem related to this, but your file path(s) do include the subdirectory still correct? (Should include the subdirectory there, but should be omitted from the above area(s).

    Oh, it could also be something in the .htaccess file(s). Should have a unique htaccess file in the sub-domain folder.
    Last edited by mc12345678; 25 Mar 2014 at 02:02 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Feb 2014
    Posts
    10
    Plugin Contributions
    0

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by mc12345678 View Post
    With HTTP_SERVER', 'http://www.mydomain.com' and the above, the store should appear as 'http://www.mydomain.com

    Assuming that the cPanel actions were performed properly to point to the subdirectory that contains your store when http://www.mydomain.com is entered. Off the top of my head I do not know what it would take to have that action occur, but it appears to be an issue with setting up the cPanel portion.

    Haven't described a problem related to this, but your file path(s) do include the subdirectory still correct? (Should include the subdirectory there, but should be omitted from the above area(s).

    Oh, it could also be something in the .htaccess file(s). Should have a unique htaccess file in the sub-domain folder.

    hi

    yes i did cpanel redirect and the 2 methods above but no luck.
    the htaccess file in the subdomain folder is blank..
    also what do you mean about filepaths containing subdirectory? can you give me an example.

    thanks alot

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by yanxin View Post
    hi

    yes i did cpanel redirect and the 2 methods above but no luck.
    the htaccess file in the subdomain folder is blank..
    also what do you mean about filepaths containing subdirectory? can you give me an example.

    thanks alot
    So, let's go with the assumption that the name you had chosen for your new servername is:
    define('HTTP_SERVER', 'http://www.yoursite.com');
    define('HTTPS_SERVER', 'https://www.yoursite.com');

    your previous/existing servername is:
    define('HTTP_SERVER', 'http://www.mysite.com');
    define('HTTPS_SERVER', 'https://www.mysite.com');

    In both cases you want the site to show as in the root of the above server name so:
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    For the original site (www.mysite.com) the FS CATALOG might be something like:
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/');

    Then you have the yoursite location that is in a subdirectory off of public_html, even though it will be a "different" server, it is still in the same file structure as the mysite location, so the new site would have a file structure of.

    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/yoursite/');

    So, it is this last part is what I was referring to about having file paths containing the subdirectory.

    Although much is missing, the yoursite configure.php file would include/contain.
    define('HTTP_SERVER', 'http://www.yoursite.com');
    define('HTTPS_SERVER', 'https://www.yoursite.com');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/yoursite/');

    The mysite configure.php would be like:
    define('HTTP_SERVER', 'http://www.mysite.com');
    define('HTTPS_SERVER', 'https://www.mysite.com');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/');
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Feb 2014
    Posts
    10
    Plugin Contributions
    0

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by mc12345678 View Post
    So, let's go with the assumption that the name you had chosen for your new servername is:
    define('HTTP_SERVER', 'http://www.yoursite.com');
    define('HTTPS_SERVER', 'https://www.yoursite.com');

    your previous/existing servername is:
    define('HTTP_SERVER', 'http://www.mysite.com');
    define('HTTPS_SERVER', 'https://www.mysite.com');

    In both cases you want the site to show as in the root of the above server name so:
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');

    For the original site (www.mysite.com) the FS CATALOG might be something like:
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/');

    Then you have the yoursite location that is in a subdirectory off of public_html, even though it will be a "different" server, it is still in the same file structure as the mysite location, so the new site would have a file structure of.

    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/yoursite/');

    So, it is this last part is what I was referring to about having file paths containing the subdirectory.

    Although much is missing, the yoursite configure.php file would include/contain.
    define('HTTP_SERVER', 'http://www.yoursite.com');
    define('HTTPS_SERVER', 'https://www.yoursite.com');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/yoursite/');

    The mysite configure.php would be like:
    define('HTTP_SERVER', 'http://www.mysite.com');
    define('HTTPS_SERVER', 'https://www.mysite.com');
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    define('DIR_FS_CATALOG', '/var/users/webserver/public_html/');

    yes all settings are as you have stated.

    i built the zenstore on a subdomain thinking i would purchase a seperate domain for it later which i have now done so but it won't work lol. i just don't like the subdomain showing in the url.

    i think i am just going to have to back up my zenstore and restore it onto the domain directly, how about it?

    thanks

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: redirecting a domain to subdomain - help needed

    Quote Originally Posted by yanxin View Post
    yes all settings are as you have stated.

    i built the zenstore on a subdomain thinking i would purchase a seperate domain for it later which i have now done so but it won't work lol. i just don't like the subdomain showing in the url.

    i think i am just going to have to back up my zenstore and restore it onto the domain directly, how about it?

    thanks
    Have you reached out to the tech support of either your hosting company or the company from which the domain was purchased? I assume you have or are playing with two domain names and not like a shared host domain name and just purchased the first domain name.

    Ask them for some assistance, it may be that they can "fix" it. But if you have the above settings as described, ZC is setup to handle the correct path, but there is somethingabout the host that is still kicking in the sub-directory in the URI.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: redirecting a domain to subdomain - help needed

    What did you do in your cPanel to setup your new domain name to point to this new subdirectory?

    Btw,I am thhinking that ZC may not like the setup currently in place because the one constant identifying the folder is not equal to the current subdirectory shown in the address bar.

    From looking online about how to setup the situation you are trying, it looks like you need to change the destination for your new domain name in the domain management portion of your cPanel to point to your new subdirectory.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Migrating subdomain to a new domain
    By jmberman in forum General Questions
    Replies: 5
    Last Post: 17 May 2016, 07:21 PM
  2. Replies: 6
    Last Post: 19 Jun 2011, 07:06 AM
  3. Domain.com is redirecting to Domain.com/admin/login.php?
    By tightplace in forum General Questions
    Replies: 1
    Last Post: 15 Oct 2010, 06:44 AM
  4. Moving to from Subdomain to Domain
    By marks3 in forum Installing on a Windows Server
    Replies: 1
    Last Post: 5 Jun 2006, 09:33 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR