Home Learn More Purchase Knowledge Base Support Contact

Community Forums

KBPublisher Forums » KBPublisher Code Hacks and Customization Discussion

Using aMember with KBPublisher for paying subscribers

(6 posts)

  1. bayhouse
    Member

    I've been using the free ver 2 along with aMember for paying subscribers. My notes from 2007:
    "COMBINE existing htaccess with amember htaccess"

    I tried that, but then can't get to individual categories and post, I can only access the KBP front page. Get 404 errors. Is there anything else to change in the .htaccess to make it work?

    The new 3.5 is VERY cool and I'd hate to have to go back to ver. 2.

    Also, appreciate any tips on other ways to utilize KBP for PAYING subscribers.

    Posted 1 year ago #
  2. onesign
    Key Master

    Hello,

    I have no idea what is aMember.
    Would you please give us more information?

    Posted 1 year ago #
  3. bayhouse
    Member

    aMember signs up my subscribers and then I restrict access to certain directories to subscribers.

    So in ver. 2, I simply combined the two htaccess files and it worked perfectly.

    Here's the aMember htaccess:

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

    ## allow access for any active subscription
    RewriteCond %{HTTP_COOKIE} amember_nr=([a-zA-Z0-9]+)
    RewriteCond /home/factors/public_html/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 ^(.*)$ https://mydomain.com/amember/plugins/protect/new_rewrite/login.php?v=-any&url=%{REQUEST_URI}?%{QUERY_STRING} [L,R]
    RewriteRule ^(.*)$ https://mydomain.com/amember/plugins/protect/new_rewrite/login.php?v=-any&url=%{REQUEST_URI} [L,R]
    ########### AMEMBER FINISH ####################

    Combining the files gets me the 404s for posts and categories, but the front page works.

    Posted 1 year ago #
  4. onesign
    Key Master

    The same (combine .htaccess) should work for v3.5 but you should make sure
    that rules does not conflict.
    Maybe you need add some extra one, or add some condition, etc.

    Another option that may work is to disable KBPublisher .htaccess by renaming it to _.htaccess

    Posted 1 year ago #
  5. bayhouse
    Member

    Here's the KBPublisher htaccess:

    Options -Indexes
    DirectoryIndex index.php
    #<IfModule mod_dir.c>
    # DirectoryIndex index.php
    #</IfModule>

    <FilesMatch "\.(ini|sql)$">
    oorder deny,allow
    odeny from all
    </FilesMatch>

    <IfModule mod_rewrite.c>

    SetEnv KBP_REWRITE 1

    RewriteEngine on
    o#RewriteBase /kb
    oOptions +FollowSymlinks -Multiviews

    #RewriteCond %{SERVER_PORT} !443
    o#RewriteRule (.*) https://secure.your-domain.com/ [R]

    #To redirect all images to a static location, so that there's no overhead
    o#If the image location is the same as the original URL, use a hyphen as the second argument.
    oRewriteRule ^.*\.(jpg|gif|png|css|js)$ - [L,PT]

    # KNOWLEDGE -------------------

    RewriteRule ^([0-9]+)/?(/([a-zA-Z_]+))?/?$ index.php?CategoryID=$1&Msg=$3 [QSA,L]
    oRewriteRule ^(book|files|print-cat)/([0-9]+)/?$ index.php?View=$1&CategoryID=$2 [QSA,L]
    oRewriteRule ^(news)/c([0-9]+)/?$ index.php?View=$1&CategoryID=$2 [QSA,L]

    RewriteRule ^([a-zA-Z_-]+)/([a-zA-Z0-9_,.!?'/()\+\-]+)_([0-9]+)\.html$ index.php?View=$1&EntryID=$3&EntryTitle=$2 [QSA,L]
    oRewriteRule ^([a-zA-Z0-9_,.!?'/()\+\-]+)_([0-9]+)\.html$ index.php?View=entry&EntryID=$2&EntryTitle=$1 [QSA,L]
    oRewriteRule ^([a-zA-Z0-9_,.!?'/()\+\-]+)_([0-9]+)\.pdf$ index.php?View=pdf&EntryID=$2&EntryTitle=$1 [QSA,L]

    RewriteRule ^([a-zA-Z_-]+)(/([0-9]+))?(/([a-zA-Z_]+))?/?$ index.php?View=$1&EntryID=$3&Msg=$5 [QSA,L]
    oRewriteRule ^([a-zA-Z_-]+)(/([0-9]+))?(/([0-9]+))?(/([a-zA-Z_]+))?/?$ index.php?View=$1&CategoryID=$3&EntryID=$5&Msg=$7 [QSA,L]

    # /KNOWLEDGE -------------------

    </IfModule>

    #php_value session.use_trans_sid 0
    #php_value session.use_only_cookies 1

    #php_value arg_separator.output &
    #php_value arg_separator.input &

    #php_flag zlib.output_compression On
    #php_value zlib.output_compression_level 5

    # It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions.
    # For example, if is set for 7, mail, strings and regular expression functions should be overloaded.
    #php_value mbstring.func_overload 2

    #The maximum size of an uploaded file.
    #default 2M
    #php_value upload_max_filesize "2M"

    #Sets max size of post data allowed. This setting also affects file upload.
    #To upload large files, this value must be larger than upload_max_filesize.
    #default 8M
    #php_value post_max_size "8M"

    #If memory limit is enabled by your configure script,
    #also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
    #default 8M
    #php_value memory_limit "32M"

    ---------------------------------------------

    When I use ONLY the aMember htaccess, we have no access at all and will NOT redirect to the login page either.

    When I combine, we have access to the KBP front page, but not to the categories and articles.

    I can only assume that it has something to do with the rewrite rules, but really don't have a clue.

    Posted 1 year ago #
  6. bayhouse
    Member

    Well, now I'm really confused. I had amember create the htaccess again and I tried it again with ONLY the amember htaccess and it seems to work. Thanks!

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

© 2008 Double Jade LLC | customer.service@kbpublisher.com