404 Error When Protect Directory in Wordpres

Discussion in 'Setting-up protection' started by zimsolve, Aug 4, 2008.

  1. zimsolve

    zimsolve New Member

    Joined:
    Apr 5, 2007
    Messages:
    21
    When I protect my wordpress directory /members in amember and I try to access my "pages" that were created in wp, I get a 404 error. I'm using the "new_rewrite" in amember.

    When I remove the protection, the pages work just fine.

    I have my pages and posts written in wp as "%category%/%postname%/"

    I'm sure this may have something to do with the rewrite.

    Any ideas on how to keep to rewrite in wordpress and have amember protect the pages?
  2. zimsolve

    zimsolve New Member

    Joined:
    Apr 5, 2007
    Messages:
    21
    I did some testing and found that the error stems from .htaccess file.

    When I protect a directory amember puts in some information and
    also since I have the permalinks in wordpress set as "/%category%/%postname%" it conflicts with each other.

    The .htaccess file I have when I set the "new-rewrite" is:

    ########### AMEMBER START #####################
    Options +FollowSymLinks
    RewriteEngine On

    ## allow access for any active subscription
    RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
    RewriteCond /home/site/public_html/breaking/amember/data/new_rewrite/%1 -f
    RewriteRule ^(.*)$ - [L]

    ## if user is not authorized, redirect to login page
    # BrowserMatch "MSIE" force-no-vary
    RewriteCond %{QUERY_STRING} (.+)
    RewriteRule ^(.*)$ http://www.website.com/amember/plugins/protect/new_rewrite/login.php?v=-any&url=%{REQUEST_URI}?%{QUERY_STRING} [L,R]
    RewriteRule ^(.*)$ http://www.website.com/amember/plugins/protect/new_rewrite/login.php?v=-any&url=%{REQUEST_URI} [L,R]
    ########### AMEMBER FINISH ####################

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /members/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /members/index.php [L]
    </IfModule>

    It messes up the permalinks for the "pages" not the "posts."
  3. zimsolve

    zimsolve New Member

    Joined:
    Apr 5, 2007
    Messages:
    21
    Anybody? Any input would be appreciated.

    Thanks
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
  5. linuxbastard

    linuxbastard New Member

    Joined:
    Oct 8, 2008
    Messages:
    1
    wordpresssamember site broken

    Hi David,

    I don't know if this is just me but I tried your wordpressamember demo site and even if I'm logged on as gold I can't read the gold subscription posts.

    I tried it on two computers, same thing.

    I don't know how to post this so I just added it here.
  6. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Thanks! Fixed. Working now.

    David

Share This Page