Magento

eCommerce Software for Online Growth

Magento Forum

From setting up your store to managing your products, pages and promotions to generating detailed reports, the Magento User Guide empowers the user to utilize the platform for all of its vast capacity.
Available in eBook and Print formats – Download Now!!!
   
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:  511
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 

A mix of inspiring Magento Designs & Screencasts from over the web Magentomix.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:  165
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 2010 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
177720 users|1097 users currently online|277221 forum posts