Too many redirects

Discussion in 'Setting-up protection' started by clangalb, Jul 25, 2020.

Thread Status:
Not open for further replies.
  1. clangalb

    clangalb aMember Pro Customer

    Joined:
    Jul 12, 2020
    Messages:
    6
    I am having the problem of too many redirects on a protected folder. I have looked at previous forum threads on this topic and have tried things like clearing cache, different browsers and devices but no luck.
    Below is the htaccess code :-
    ########### AMEMBER START #####################
    Options +FollowSymLinks
    RewriteEngine On

    # if cookie is set and file exists, stop rewriting and show page
    RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
    RewriteCond /home/clanga8/public_html/amember/data/new-rewrite/%1-9 -f
    RewriteRule ^(.*)$ - [S=3]

    # if cookie is set but folder file does not exists, user has no access to given folder
    RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
    RewriteCond /home/clanga8/public_html/amember/data/new-rewrite/%1-9 !-f
    RewriteRule ^(.*)$ https://www.clangalbraith.org/amemb...{QUERY_STRING}&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R]

    ## if user is not authorized, redirect to login page
    # BrowserMatch "MSIE" force-no-vary
    RewriteCond %{QUERY_STRING} (.+)
    RewriteRule ^(.*)$ https://www.clangalbraith.org/amemb...EQUEST_URI}?%1&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R,B]
    RewriteRule ^(.*)$ https://www.clangalbraith.org/amemb...%{REQUEST_URI}&host=%{HTTP_HOST}&ssl=%{HTTPS} [L,R]
    ########### AMEMBER FINISH ####################

    I used Chrome web developers tools to try and track the loop and here is what I get :-

    amemberdocs/
    9?url=/amemberdocs/%3f&host=www.clangalbraith.org&ssl=on
    new-rewrite?f=9&url=%2Famemberdocs%2F%3F&host=www.clangalbraith.org&ssl=on
    amemberdocs/
    (repeated etc.)

    Can anyone suggest a fix please.
    Simon
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
  3. clangalb

    clangalb aMember Pro Customer

    Joined:
    Jul 12, 2020
    Messages:
    6
    Thanks, matter has been resolved.
    caesar likes this.
Thread Status:
Not open for further replies.

Share This Page