Forums / General Questions / zen-cart.com -> www.zen-cart.com -- How to do?

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

Locked

Views: 1,927

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
18 Dec 2006, 1:17 PM
#1
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

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 https://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)

18 Dec 2006, 1:48 PM
#2
brent avatar

brent

Totally Zenned

Join Date:
Mar 2005
Location:
United Kingdom
Posts:
606
Plugin Contributions:
0

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 https://www.mydomain.com or mydomain.com.

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

18 Dec 2006, 2:12 PM
#3
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

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

Brent:

You can set that via your two configure.php files. The define is either set to https://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.

18 Dec 2006, 3:36 PM
#4
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

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...

<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...

<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

18 Dec 2006, 4:39 PM
#6
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

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

OK I found it.

http://enarion.net/web/apache/htaccess/redirect-www-and-no-www/

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

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

18 Dec 2006, 5:02 PM
#7
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

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

18 Dec 2006, 5:46 PM
#8
qhome avatar

qhome

Totally Zenned

Join Date:
Feb 2004
Posts:
1,702
Plugin Contributions:
5

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 :)