Call-back icon  Enterprise Sales: +1.310.775.2674 (N. America)   +44 20.3286.4137 (UK)

Magento

eCommerce Software for Online Growth

Magento Forum

   
www vs non-www
 
bigcheese
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-09-17
 

I’ve heard it’s a good practice to choose one and stick with it. Question is, how do I choose this in Magento?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gui
Guru
 
Avatar
Total Posts:  430
Joined:  2008-03-09
 

when installing you can choose a base-url. If you leave the www you will have sitepages without the www.

You can also change it from the configuration in the backend after installing, but how that affects the system I don’t know.

 Signature 

-- On Air: Magento Screencasts on Mage-screencast.com
-- Store proudly hosted by Properhost.net on a LightSpeed server. Not affiliated just a satisfied customer.

 
Magento Community Magento Community
Magento Community
Magento Community
 
HarryHobbes
Jr. Member
 
Total Posts:  3
Joined:  2008-07-20
 

This is something you might want to put into your .htaccess file.

Like so:

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

 
Magento Community Magento Community
Magento Community
Magento Community
 
redvinny
Member
 
Total Posts:  44
Joined:  2008-11-22
 

The above rewrite plays havoc with your site.  does any one know how to redirect non www to the www equivalent when your magento install is in a subdirectory?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
redvinny
Member
 
Total Posts:  44
Joined:  2008-11-22
 

apologies: i sorted the non www redirect when installing magento in sub dir

RewriteEngine On
RewriteBase /magento_directory/
RewriteCond %{HTTP_HOST} !^www\.domain\.com

[NC]
RewriteRule ^(.*) http://www.domain/magento_directory/

$1 [L,R=301]

Make sure the code goes atthe top of htaccess in shop directory - NOT SITE ROOT

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danielc1234
Sr. Member
 
Avatar
Total Posts:  155
Joined:  2008-01-09
Miami, FL - United States
 

If I am doing a multipal site install and want all the sites to revert to www, does magento allow for .htaccess files for each site within a sub directory? I am changing the sites path in the index.php like below and want all sites to resolve to www. I already set it in the admin, but the search engines has already indexed us without the www. Any Ideas?

$host = explode(’:’, $_SERVER[’HTTP_HOST’]);
switch ($host[0])
{
case (’site1.cc’):
case (’www.site1.cc’):
$store = ‘site1’;
break;
case (’site2.cc’):
case (’www.site2.cc’):
$store = ‘site2’;
break;
case (’site3.cc’):
case (’www.site3.cc’):
$store = ‘site3’;
break;
default:
$store = ‘’;
}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2009 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
108779 users|293 users currently online|199888 forum posts