I'm not sure of the best forum to ask this in, and I suspect my lack of understanding of terminology may be limiting my ability to find what I'm looking for as I suspect my question is likely already answered (but I can't find it).
I have some resources on our cPanel server in a separate directory that I only want accessible to registered XenForo users.
This directory (downloads) is at the same folder level as our forum installation (xenforo).
public_html/xenforo
public_html/downloads
After some searching around, I've tried adding this to the .htaccess file in the downloads directory:
Can anyone shed some light on the right way to go about this or at least correct my terminology etc. so I can start looking in the right places?
I'm more than happy to be taught how to fish!
I have some resources on our cPanel server in a separate directory that I only want accessible to registered XenForo users.
This directory (downloads) is at the same folder level as our forum installation (xenforo).
public_html/xenforo
public_html/downloads
After some searching around, I've tried adding this to the .htaccess file in the downloads directory:
My testing shows this works in so much as a user who has not authenticated will be redirected to the XenForo login page, but once logged in, they are not redirected to the downloads URL, but instead continue to see the message in XenForo that they are already logged in.RewriteEngine On
RewriteCond %{HTTP_COOKIE} !xf_user=([^;]+)
RewriteRule ^ /xenforo/index.php?login/&redirect=%{REQUEST_URI} [L,R=302]
Can anyone shed some light on the right way to go about this or at least correct my terminology etc. so I can start looking in the right places?
I'm more than happy to be taught how to fish!