Entries Tagged 'Protection FAQ' ↓

Protecting Files

Section I: Protecting Files Under WordPress

This is the fastest, easiest way to protect files. And this is what is highly recommended.

1) Upload them to your WordPress blog when you are writing a new post. All such files will be stored in a folder called “wp-content/uploads/….“.

For large files, you could simply upload them directly using FTP, directly into the “wp-content/uploads/” folder and DAP is configured right off-the-shelf to “look” for any file inside the “wp-content/uploads/” folder. But once the file is under the “wp-content/uploads/…” folder (either directly under it, or under a sub-folder, like wp-content/uploads/videos/), you will now still need to let DAP know that this file is to be protected as part of a Product.

NOTE: You DO NOT have to upload files using the WP file uploader (like some of our competitors force you to do!). You can use regular, plain ol’ FTP, using a client like FileZilla or CuteFTP, or your webhost cPanel’s FTP feature.

2) Go to the product you wish to protect the file as part of, and then scroll down to the “ContentResponder” section.

2.1) If you know (or can figure out) the full URL to your file – like http://www.YourSite.com/wp-content/uploads/coolreport.pdf - you can simply paste that directly into the field “A” (in the image below)

2.2) Or, if you can’t figure out the full URL, then you can enter “wp-content” (if your blog is directly in your root folder) – or “blog” or “members” (if your blog is not in your root, and is in a sub-folder) into field “B” below, and then click on “Load Files”, and it will show you all files under that folder. And you will be able to scroll through and look for your file. And there click on the “Add” link right next to that file name you wish to protect.

Once you do (2.1) or (2.2) above, the file will get added to the Product, and will now be protected.

Section 2: Protecting Files Outside of WordPress

There is a simple, one-time setup involved if you want to protect files outside of your WordPress directory.

1. You need to add the following code to the .htaccess in the root of your web site. So, in your web site’s root folder (where you have your home page – like index.php or index.html for example)…

i) if you already have an existing .htaccess file there, then just open it, COPY the text from below and PASTE it at the very end of this file.

ii) If there is no .htaccess in your root folder, then create one, and then open it, COPY the text from below and PASTE it at the very end of this file.


NOTE: BE SURE TO MAKE A BACK-UP OF YOUR EXISTING .htaccess FILE FIRST

#Paste this at the very end of your .htaccess file
#in your web site's root folder

<IfModule mod_rewrite.c>
#dap
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !dapclient.php
RewriteCond %{REQUEST_URI} !^/dap/
RewriteCond %{REQUEST_FILENAME} !(.*)(\.php|\.css|\.js|\.jpg|\.gif|\.png|\.txt)$
RewriteRule (.*) /dap/client/website/dapclient.php?dapref=/$1&plug=wp&%{QUERY_STRING} [L]
</IfModule>

 

Doing the above enables file protection for files outside your WordPress installation folders.

2) Now go to the DAP Product you wish to protect the file as part of, and then scroll down to the “ContentResponder” section. Then…

  • If you know the full URL to your file – like http://www.YourSite.com/reports/coolreport.pdf – you could simply paste that directly into the field “A” from the image above (make sure you “visit” this URL first and verify that there is actually such a file at this link)
  • OR… if you can’t figure out the full URL, then you can enter the text “reports” (the name of your top-level folder where your file is) into field “B” from the image above, and then click on “Load Files”, and it will show you all files under that folder. And you will be able to scroll through and look for your file. And there click on the “Add” link right next to that file name you wish to protect.

The file is then added to the Product, and will now be protected as part of that Product.

That’s it.

Testing File Protection

Open a different browser (not different window – a totally different browser – like, if you’re logged in as DAP admin in FireFox, then open IE)  and try to access your file directly and see if DAP redirects you to the login screen.

If not, take a deep breath – it’s NOT DAP :-)

It’s just that you probably missed something during the setup.

Revisit the steps above, and if you still can’t figure it out, you might want to think about uploading the file to wordpress (see Section I above) .

If you need help, then just open a support ticket with as many details as possible, and we’re standing by to help you.

Recommended Reading

If you have a number of large files to deliver to your members, then you should consider hosting your files on Amazon S3. And here’s why…

Protecting WordPress Posts & Pages

  • Log in to DAP Dashboard and go to the “Products/Lists” page.
  • Select the product to which you want this blog post/page to be a part of
  • Scroll down to the “ContentResponder” section
  • On the left, you will see a list of blog posts & pages that have been published (if you scroll down in the window where the list of “posts” show, you will also see list of “pages”)

  • Select one or more (hold Ctrl + Click to select multiple)
  • Click on “Add Selected Posts/Pages” to protect the posts/pages.
  • The post(s)/page(s) will now show up on the right-hand side of the box.
  • Click on “edit” next to each link to configure dripping for individual posts/pages.

Creating A Login Page Within WordPress

Now DAP already provides you with a built-in, out-of-the-box login form, at YourSite.com/dap/login.php . But if you want to put this form “within” your WordPress blog, so as to give your login form the same Look & Feel as the rest of your blog, then do this…

1) Create a WordPress Page (not “Post”) with the text %%LOGIN_FORM%% in the body of the page, and a title of say, Login, and save the new page. If you used the text “Login” for the title, then the actual link to this page would be YourSite.com/blog/login

2) This page now shows up as “Login” along with the rest of your “pages” on your blog.

3) Go to DAP Admin > Setup > Config . Scroll down to the field Login URL

In the text box, enter the full link to your login page from Step 1:
http://YourSite.com/blog/login

Or if your blog is in the root, then…

http://YourSite.com/login

That’s it! When someone clicks on the “Login” link that now shows in your “Pages” menu, they will now see a nicely formatted login form.

Related: Where is the Logout Link?

Using Sneak-Peek For Blog Posts

By default, none of the posts or pages you have protected in DAP will be visible in any of the WP menus (not even in custom menus).

Which means, as far as your visitors (or search engines) are concerned, those posts/pages don’t even exist in your blog – until the content “drips” on them.

Some DAP users want it that way, and some don’t.

Also, from an SEO perspective, if your visitor (who is not a member, and one who is not logged in) can’t even see the post, then neither can Google. This means, if you do a blog-and-ping, when Google arrives at the permalink of your new post, because the post is protected, DAP will redirect Google to your login page. This means, you don’ get the benefit of SEO for your new post.

Also, from a “Curiosity” standpoint, if you protect all of the posts, then your visitor will only see a handful of non-protected blog posts, and logged-in members will see only content that has already dripped on them (accessible to them).

Giving them a “sneak-peek” of the protected content is a great way to get them excited about your content.

So for example, you could have a blog post that talks about a video, and goes into detail about everything that they can learn from watching the video – but the content ends just before the video, and where the video would’ve normally appeared, there appears a “Login Form” that asks them to login first before they can view the content, or purchase access if they wanted to see the video.

How to turn on Sneak-Peek

Go to DAP Dashboard > Config > WordPress Sneak-Peek

It is set to “N” (no) by default. Change this to “Y” and click on the “Update” button to save the change.

And then when they click on the “more” button to read the rest of the post, the full post is protected anyway, and they are presented with a login screen.

WARNING: READ THIS BEFORE YOU TURN ON SNEAK-PEEK

As soon as you turn on Sneak-Peek, DAP will show all content from your blog posts, but only up to the “More” tag. This means, if you don’t have a “More” tag in any of your content, then all of your blog posts will show to all users, regardless of whether they have access or not.

So, the most important thing here is this:

SNEAK-PEEK and MORE are INSEPARABLE.

If you do sneak-peek, you MUST include a “More” tag.

So when you create a WordPress blog post, split the post into two parts using the “More” tag. This creates a “public preview” portion of the actual post, that shows up on your blog’s home page and in the permalink when that post is displayed. To read the rest of the post, your visitor has to click on the “More” link, and that’s when depending on whether the user has access, the rest of the post will be displayed.

Protection: WordPress Blog Posts and Files – FAQ

How do I protect a blog post?

  1. Log in to DAP Dashboard and go to the “Products/Lists” page.
  2. Select the product to which you want this blog post to be a part of
  3. Scroll down to the “ContentResponder” section
  4. On the left, you will see a list of blog posts & pages that have been published
  5. Select one or more (hold Ctrl + Click to select multiple)
  6. Click on “Add Selected Posts/Pages” to protect the posts/pages.
  7. It will now show up on the right-hand side of the box.
  8. Click on “Edit” next to each link to configure dripping.

How do I protect a file?

Use the “File Browser” on the “Products/Lists” page to browse through a folder on your web site, and next to each file, you will see an “Add” link. Clicking on that link will add that file to the product.

I have protected a blog post. But I can still view it without logging in.

1. Are you already logged in a a user who has access to that link? Maybe logged in as DAP Admin, and that is why you are able to access the link? If so, either log out of DAP, or visit your blog in a completely new browser (if you’re logged in as DAP Admin in FireFox, then visit your blog using Internet Explorer).

2. After you set up DAP, did you visit the “Permalinks” section and click on the “Save” button at least once (even if you didn’t make any changes to your permalinks structure)?

3. Have you added the blog post to a Product? If you don’t add it to a DAP Product, the post or file won’t be protected.

Can I protect an entire category of posts at one go?

Yes, absolutely!

See Protecting An Entire WordPress Category.

Why do I see all of the protected posts on my blog’s home page? (OR) I don’t want the links to all my blog posts showing up on my blog

Make sure you have “Sneak-Peek” turned off in the DAP Admin Config section. Once you do that, posts that are protected will not be displayed on the home page as well as if someone tried to visit the link directly.

When I try to browse through the files on my server, on the Products page, I get a  popup error msg that says ‘There was an error returning data”.

(OR)

When adding Folder name ‘To Protect Files’ option the js loader keeps on loading.

On looking at the Error Console of the browser it shows the error”Error: missing ) in parenthetical”
Source File: http://www.yoursite.com/dap/admin/addEditProducts.php?productId=1
Line: 29, Column: 8
Source Code: (Unable to open ../../../AdminSorry, too many files being returned. Please use filter to reduce the number.)

Answer: Those are all symptoms of the same issue: Too many files to load in the little “file browser” section, and DAP is timing out.

If you know the path to the file, then just form the URL directly in your text editor – like…

http://www.yoursite.com/wp-content/uploads/interview.mp3 (example)

Visit the link to make sure that there is no typo in the URL, and make sure that the file is there for download (you’ll see the “Download or Save as” popup).

Then simply paste that URL into the Add URL field and protect it.