Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default zen-cart.com -> www.zen-cart.com -- How to do?

    This one is aimed at a simple question to the zen-cart webmaster.

    On my old site, I was using a shared reseller that had *.sharedssl.com. This was nice because no matter what subdomain, it would kick in ssl without giving the prompt about the addresses not matching up.

    Now I got a real one for my site alone and it had to be www.mysite.com so only "www" will not give the warning. I thought I had it set in my .htaccess to mod_rewrite prepend the "www" onto the front of the domain name so that if someone typed "http://mydomain.com" it would redirect to "http://www.mydomain.com"

    But apparently not.

    I tried searching htaccess help online but either I don't know what I'm reading or I'm just not searching for the right terms.

    I thought it was this code:
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.com
    RewriteRule ^/(.*)$ /home/%1/www/$1 [L]

    But I don't really know what that does.


    I do notice that "zen-cart.com" turns into "www.zen-cart.com". And I'm wondering are you just using a simple redirect for ALL versions of the url to a "www" version of the domain? or are you checking to see if the www is already on there and using some sort of rewrite?

    How do you do it? (assuming .htaccess)

  2. #2
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    You can set that via your two configure.php files. The define is either set to www.mydomain.com or mydomain.com.

    Ages since I did it but I think that was all there was to it.

  3. #3
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    Quote Originally Posted by Brent View Post
    You can set that via your two configure.php files. The define is either set to www.mydomain.com or mydomain.com.

    Ages since I did it but I think that was all there was to it.
    That works for after a customer clicks a link, but not on initial page load. That would have to be done with .htaccess before the page loads. But if a customer followed a google link to a secure page, it would give them the warning if google searched it without the www. prepend. Plus it seems to work on the zen-cart forums, and wiki and other parts of the site so it is likely set to globally affect anything in the domain.

  4. #4
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    Thinking way too complicated. Do you have access to your Apache httpd.conf file? Go to your VirtualHosts section, make your site entry read something like this...
    Code:
    <VirtualHost 123.123.123.123:80>
    DocumentRoot /www/mysite/
    ServerName mydomain.com
    ServerAlias www.mydomain.com
    LogLevel emerg
    </VirtualHost>
    You could take this a step further, and make all subdomains point to your primary like so...
    Code:
    <VirtualHost 123.123.123.123:80>
    DocumentRoot /www/mysite/
    ServerName mydomain.com
    ServerAlias *.mydomain.com
    LogLevel emerg
    </VirtualHost>
    /edit: This is exactly how I have my sites set up.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  5. #5
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    I'm Using unix host. I'm certain the change is in the htaccess file.

  6. #6
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    OK I found it.

    http://enarion.net/web/apache/htacce...ww-and-no-www/

    edit .htaccess and add this (change domain.com to your domain):

    RewriteEngine On
    RewriteBase /
    RewriteCond &#37;{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

  7. #7
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    Q your initial page load isnt Secure anyway so it dosnt matter,
    ypu can come in with http://yoursite and the first click will take them to http://www

    and first click to ssl with go to https://www
    Zen cart PCI compliant Hosting

  8. #8
    Join Date
    Feb 2004
    Posts
    1,774
    Plugin Contributions
    14

    Default Re: zen-cart.com -> www.zen-cart.com -- How to do?

    I would for the most part agree with that but I've seen a few times my shared ssl version of the page as the google result link from a search. The link was apparently spidered that way, so from google I could click and be redirected to a product with an https:// protocol prefix. I find it hard to understand how it even managed that but it did.

    I'm also just a knowledge whore so I like to know how anyway :)

 

 

Similar Threads

  1. Replies: 5
    Last Post: 27 Apr 2010, 07:56 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