Best practice for $config wwwroot ?

I am testing the latest Elgg 3.5.5
I was just wondering what should be the ideal value to enter in

$CONFIG->wwwroot = "https :// www mysite /elg/";
OR
$CONFIG->wwwroot = "https:// mysite /elgg/";

If I keep wwwroot = "https :// www mysite /elgg/" users face this problem:
if they visit https:// mysite /elg/ they can access the site and see its pages BUT cannot login : on entering username/password there is NO error message, nothing happens in fact.
I understand already that there can be some ht access tricks but is there anything that can be set at $CONFIG->wwwroot level so that site login is possible at both https:// mysite /elgg and https:// www mysite /elgg ? Thanks.

  • is there anything that can be set at $CONFIG->wwwroot level so that site login is possible at both https:// mysite /elgg and https:// www mysite /elgg ?

    I think it's impossible. You must control this via server's config only.

    Also, using 'doubles' is a bad SEO practice.

     

  • Another thing I find with (in the above example) is that in https:// mysite /elg/
    default/icon/user/default/small.gif shows up nicely but the magnifying glass icon in search box does not show up.  In  https:// www mysite /elgg  both shows up.

    You must control this via server's config only.


    $CONFIG->wwwroot : this is in the config file only. So I was wondering if another value or if any if-else logic could be added here only, that could re-direct.

    using 'doubles' is a bad SEO practice -

    this is not very clear to me. What is 'doubles'? Thanks.

  • Regarding icons, seems they was saved in DB with your mentioned URLs.

    You can add rewrite rules in your server's config.

    Your server's config file is .htaccess for Apache.

    Read more about 'doubles' aka 'duplicate content'.

  • on entering username/password there is NO error message, nothing happens in fact.

    Sounds like this discussion.

  • I read and tried the solutions provided there. However, the problem remains.
    Mine is just fresh default Elgg3.5.5 install without any extra plugins and only user is admin.
    And this problem is happening just from the beginning.
    If I keep wwwroot = "https :// www mysite /elgg/" users cannot login at "https :// mysite /elgg/"
    On entering username/password there is NO error message, the screen remains as it is.
    If users visit 
    https :// www mysite /elgg/ they can login without any problem.

  • I don't understand your problem - use the right URL which works and add rewrite rule in .htaccess to redirect users and content between URLs with www and w/o www. That's all.

    And Elgg 3.3.5 ;)

  • You are right. .htaccess should solve the problem. All that I wanted is that like drupal or wordpress, any user get to login with whatever url he or she types. If its www mysite it remains www mysite throughout, and if its minus the www it remains that way, without causing impossibility in login or without inconsistencies in display of image files. If the login is not working with www or minus www, the site should not display at all or throw an error message for the user or auto-direct to correct site (code being in the script itself). 

    Logically yes, htacess should now be tried. I will play and try with that. Thanks. :)

  • Supposing this scenario
    my registered domain name : mysite.com
    my elgg : mysite.com/elgg
    Via C-Panel, I have Force HTTPS Redirect, which will redirect any plain http request to https. It redirects automatically any https to http BUT does not take care about www or plain domain names typed in without https / http / www etc

    now I want that all of  following 6  should redirect to  https://www.mysite.com/elgg
    https://www.mysite.com/elgg
    https://mysite.com/elgg     
    http://www.mysite.com/elgg
    http://mysite.com/elgg
    www.mysite.com/elgg
    mysite.com/elgg

    Should I now out my code under / below this

    ############################
    # REWRITE RULES
    
    <IfModule mod_rewrite.c>

    And should my code be l

    RewriteCond %{HTTP_HOST} ^mysite.com/elgg [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]

    Its not working - maybe its not complete or I am not doing things write. How can I get all the 6 of the above to redirect to https www site? I have seen resources on elgg and net but not sure which will work when I already have that forced https on via C-panel. Thanks.

  • I have seen resources on elgg and net but not sure which will work

    https://elgg.org/discussion/view/2841913/use-https

  • Thanks RvR. That works. Thanks Rohit Gupta.

    Off-topic : RvR, is there going to be any Elgg 3x updates for your Youtube & Twitter plugins any time soon? Thanks.