Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2006
    Posts
    38
    Plugin Contributions
    0

    Default www missing from URL

    Just did a new installation of ZC to our server.
    if you go to www.my_site.com/shop it will loadup ZC just fine, however it drops the www out of the front of the URL when ZC loads, the URL in the browser is just my_site.com/shop.

    How do I get the WWW back in the front of the URL.
    I have added the www into the configure.php in the /admin/includes and /includes directories.

    Is there something I am missing?

    If I do the www.my_site.com/shop/admin, it loads up the admin correctly into the HTTPS mode and keeps the www in the URL.

    Thanks
    Speed

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: www missing from URL

    Please post your includes/configure.php minus your passwords.

  3. #3
    Join Date
    Oct 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: www missing from URL

    From includes/configure.php
    I replaced my domain address with my_site and the root directory with my_dir, because I havent finished the site setup yet, and have not locked everything down yet.


    // Define the webserver and path parameters
    // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
    // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
    define('HTTP_SERVER', 'http://www.my_site.com');
    define('HTTPS_SERVER', 'https://www.my_site.com');

    // Use secure webserver for checkout procedure?
    define('ENABLE_SSL', 'true');

    // 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', '/shop/');
    define('DIR_WS_HTTPS_CATALOG', '/shop/');

    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
    define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
    define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

    define('DIR_WS_PHPBB', '/');

    // * DIR_FS_* = Filesystem directories (local/physical)
    //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
    define('DIR_FS_CATALOG', '/home/my_dir/public_html/shop/');

    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
    define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
    define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
    define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

    // define our database connection
    define('DB_TYPE', 'mysql');
    define('DB_PREFIX', 'shop_');
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', 'xxxxxxxx');
    define('DB_SERVER_PASSWORD', 'xxxxxxxx');
    define('DB_DATABASE', 'xxxxxxxx');
    define('USE_PCONNECT', 'false'); // use persistent connections?
    define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

    // The next 2 "defines" are for SQL cache support.
    // For SQL_CACHE_METHOD, you can select from: none, database, or file
    // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
    // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
    // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
    define('SQL_CACHE_METHOD', 'file');
    define('DIR_FS_SQL_CACHE', '/home/my_dir/public_html/shop/cache');

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: www missing from URL

    What's in your /public_html/.htaccess file?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Oct 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: www missing from URL

    One line that reads....

    Options -Indexes


    speed

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: www missing from URL

    and how about /public_html/shop/.htaccess ?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Oct 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: www missing from URL

    There is no .htaccess in the /shop folder.

    There is however an .htaccess in the /shop/includes folder which appears to be stock, which reads :

    # $Id: .htaccess 1105 2005-04-04 22:05:35Z birdbrain $
    #
    # This is used with Apache WebServers
    # The following blocks direct HTTP requests in this directory recursively
    #
    # For this to work, you must include the parameter 'Limit' to the AllowOverride configuration
    #
    # Example:
    #
    #<Directory "/usr/local/apache/htdocs">
    # AllowOverride Limit
    #
    # 'All' with also work. (This configuration is in your apache/conf/httpd.conf file)
    #
    # This does not affect PHP include/require functions
    #
    # Example: http://server/catalog/includes/application_top.php will not work

    <Files *.php>
    Order Deny,Allow
    Deny from all
    </Files>

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: www missing from URL

    Those look fine.

    What you have is odd:
    www.sitename.com if clicked as a link, converts to drop the www
    sitename.com, if clicked as a link, loads fine
    http://www.sitename.com, when clicked, is fine

    It strikes me that typically a .htaccess redirect would cause the stripping of the www

    It could be something else in your hosting configuration.

    It could be something with SSL setup, however, these are not SSL links.


    You might ask your hosting company about it too.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Oct 2006
    Posts
    38
    Plugin Contributions
    0

    Default Re: www missing from URL

    Correction:

    www.sitename.com : loads fine and stays as www.sitename.com

    www.sitename.com/shop : loads find, but drops WWW in the URL and becomes sitename.com/shop

    www.sitename.com/shop/admin : admin fine and loads as https://www.sitename/com/shop/admin

    NOTE: when I first installed it, there was one of the install boxes that asked for the domain, and i entered sitename.com (because that is the domain) without the www prefix. I then had to go back in and edit the 2 configure.php files to add WWW back in. All of the references with the application work like a champ, however the only one that doesnt is when you go to www.sitename.com/shop and it loads up ZC, but without the www at the front of the URL.

    Speed

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: www missing from URL

    As far as Zen Cart is concerned, the 2 configure.php files determine the URL.

    Anything outside that is typically a result of a server configuration issue, or sometimes hard-coded links you may add inside your customized template (which doesn't apply to you yet in this case).


    Zen Cart does not have any built-in method for redirecting from www.xxxx to non-www.xxxx URL's.
    Some addon contributions may do that, but not Zen Cart itself.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Admin URL - Can't Login With Forced WWW vs Non-WWW via .htacces
    By zywex in forum Basic Configuration
    Replies: 4
    Last Post: 29 Feb 2012, 09:07 PM
  2. Missing the www from homepage url
    By pedro_aa in forum Basic Configuration
    Replies: 7
    Last Post: 17 Oct 2010, 12:18 AM
  3. www missing from site in google - no idea why
    By Zek in forum General Questions
    Replies: 6
    Last Post: 9 Feb 2008, 04:31 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