Better Joomla / aMember integration

Discussion in 'Integration' started by rdorfman, Mar 5, 2008.

  1. rdorfman

    rdorfman New Member

    Joined:
    Feb 25, 2008
    Messages:
    12
    It has always been a problem in Joomla when a frontend user logs in at http://www.mysite.com and your Joomla $mosConfig_live_site configuration variable is set to http://mysite.com (without the 'www'). The fix is to hack configuration.php as follows (Joomla < 1.5; 1.5 is similar):
    Code:
    // $mosConfig_live_site = 'http://mysite.com';
    $mosConfig_live_site = 'http://' . $_SERVER['HTTP_HOST'];
    Now comes aMember and problem is multiplied. For example, in amember_config database table, root_url field is set to value of http://mysite.com/amember . Then if user visits Joomla site and logs in at www.mysite.com/amember/login.php , when he tries to look at his member information, with the above root_url he is redirected to http://mysite.com/amember/member.php . Here is is asked to log in again! Since the session cookies are for 2 different domains, www.mysite.com and mysite.com .
    Here is a hack to amember/rconfig.inc.php to fix the problem:
    AFTER:
    Code:
    global $config;
    if (extension_loaded('Zend Optimizer')){
        require_once($config['root_dir']."/rconfig-zend.inc.php-bin");
    } else {
        require_once($config['root_dir']."/rconfig-ioncube.inc.php");
    }
    ADD:
    Code:
        $config['root_url']    =  'http://' . $_SERVER['HTTP_HOST'] . '/amember'; 
    
    And if you wish, you can also ADD:
    Code:
        $config['root_surl']   =  'http://' . $_SERVER['HTTP_HOST'] . '/amember'; 
    
  2. speakingbadger

    speakingbadger New Member

    Joined:
    Jan 5, 2008
    Messages:
    14
    I'm no programmer and I don't really understand or know much about PHP and smarty, but wouldn't it just be easier to have everything installed at the http://mysite.com instead of www.mysite.com?? Since Google and many other search engines penalize a site for duplicate content on www.mysite.com and http://mysite.com, if they indeed point to the same content... isn't it just better to set your .htaccess file to have a permanent redirect?? Then you could just use this code in your .htaccess file and you shouldn't have the problem you are referring too...

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^mysite.com$ [NC]
    RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
    This code actually is to redirect to http://mysite.com whenever someone types www.mysite.com. You can do it either way...

    Again, perhaps I'm clueless here and don't totally get the problem mentioned... and if so, I'm pretty sure you should probably do this fix on your domain anyway, since it will help your rankings. Or just use totally different content on www, than what you use without www.

    Hope that helps someone...
    Justin
    www.alliantnetwork.org
  3. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    I am quite sure this is one of those SEO myths. Although I have my own reasons not to be in love with the big G, they are not stupid enough to expect the content at http://mysite.com and http://www.mysite.com to differ.

    In other words, although "www.mysite.com" is, technically, a subdomain of "mysite.com" and could have completely different content, it is normally not so and Google knows this for sure. You may try asking them directly but I doubt you will get a meaningful answer from them.

    So from the SEO perspective, I wouldn't really care about this...

    Tomas
  4. speakingbadger

    speakingbadger New Member

    Joined:
    Jan 5, 2008
    Messages:
    14
    Actually I have verified it through about 3 or 4 different sources... Yahoo, Google and MSN all penalize you in your rankings for those two different domains...I'm not sure of all the technical details, but even in amember, setting your domain up as www.mysite.com is completely different from mysite.com...I know because it screwed me up and I had to get help from support about it....

    There are actually a number of sites that have completely different pages at www.mysite.com than they do at mysite.com. www is basically equivalent to any other subdomain name i.e. domain.mysite.com... What's to keep this from being treated any differently? Have you ever accidentally not set your domain up correctly and only had www.mysite.com work, while mysite.com couldn't be found...?? If they are the same, how can that happen??

    So yes, you should pay attention to it... until every search engine out there says, "Hey we have changed our programming and no longer penalize you for duplicate content and we definitely don't treat www as separate from mysite.com..." Then I would think about it and probably do whatever I could to correct the problem as simply as possible.

    I'm not a programmer or an SEO expert, but I do know that they are treated completely differently even within linux server code, so it would actually make sense that IF a search engine penalizes you for duplicate content, which most nowadays most do, then www.mysite.com would end up being treated very, very different from mysite.com... That is just basic logic...


    Justin Taylor

    http://alliantnetwork.org - The Business Benefits Network

    [​IMG]

Share This Page