Protecing my Membership Service on Root while Amember in Sub Folder..

Discussion in 'Setting-up protection' started by rricart, Jun 25, 2008.

  1. rricart

    rricart New Member

    Joined:
    Jun 16, 2008
    Messages:
    3
    Hello Everyone,

    I have my merbership social network installed on the root..

    http://www.mysite.com

    and I have amember installed in http://www.mysite.com/amember/

    can I protect the root from non-members reaching it if Amember is installed in a sub folder of that same root?

    I hope I was clear...thanks!
    RRicart
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    What are you using for your social network?

    There are a number of ways this could work:

    1) You are using a plugin to provide single signon to your application
    2) You are using PHP based protection in the code of your social network
    3) You have crafted a well defined .htaccess file in the root directory that excludes the root rules from taking effect on subdirectories
  3. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I think you're over complicating things.
    It would be simpler to put your protected area as a subdirectory, and simply redirect the root to that subdirectory using a root htaccess

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.yoursite\.com [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^(.*) http://www.yoursite.com/$1 [L,R]
    RewriteRule ^(/)?$ /cms/ [L]


    David

Share This Page