Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Domain changes


rgloverd

Recommended Posts

Posted

I was just about to buy an ssl certificate, but just noticed that the url changes.

When you first arrive at the shop it is in the form www.mydomain.co.uk

But when you click on anything and go to another page it gets rid of the 'www'

SO what do I get the certificate for is there a way to make it keep the 'www'

Any ideas,

Thanks,

Richard

Posted

Are you using a pointing domain?

I have one at www.thecdrstore.co.uk!

I had to make a welcome page and then I forwaded to my store withthe target "top" so it tookover the whole page and then use store one!

Our SSL is at the 34sp address!

 

I hope this helps

Posted

Setup your .htaccess file at the root directory read as *something* like the following:

 

# =============================================================
#   <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
#   -----------------------------------------------------------
#    Rewrite the IP *yourIP* to non-canonical
    RewriteCond %{HTTP_HOST} 255\.255\.255\.255
    RewriteRule ^(.*)  http://yourdomain.com/$1 [L,R=301]
#   -----------------------------------------------------------
#    Rewrite the canonical URL to the non-canonical
    RewriteCond %{HTTP_HOST} www\.yourdomain\.com [NC]
    RewriteRule ^(.*)  http://yourdomain\.com/$1 [L,R=301]
#   -----------------------------------------------------------
  </IfModule>
# =============================================================

Then, in your includes/configure.php file make it look *something* like this:

define('HTTP_SERVER', 'http://yourdomain.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://yourdomain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', '.yourdomain.com');
define('HTTPS_COOKIE_DOMAIN', '.yourdomain.com');

The the .access file change just rewrites the URL's to always use the non-canonical address (leave off the www.) Also, it will automatically rewrite any direct IP address calls.

 

The second part serves 2 purposes. First, it defines the HTTP(S) servers as the non-canonical form. Second, it defines the cookies to have domain wide scope (just adds a bit of versatility if you need store cookies access for other areas like forums).

Posted

Geez...the entire original post was written to drop the www. from the address and my reply was how to do the exact opposite.

 

IMPORTANT NOTE: the pevious reply will remove all references to the www. form of the address completely rewriting as necessary. The author wanted the exact opposite.

 

Now that you see the code example just flip some values to yield the opposite. If you need help beyond that just post back...

Posted

Hi,

Thanks for the help, but im confused im new to ssl, this is the first time I am going to have to use it. Which way do you think is the best approach, losing the www or keeping it, as this will make a difference to the certificate I buy? am i right in saying this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...