Hi,
I’m trying to password protect the content of a folder (insides assets). This folder contains word documents and pdfs. I have a hidden page that is password protected and that accesses the files. To make these more secure I tried adding a htaccess and htpasswd file to the folder. Unfortunately when a users clicks on the word dcument url this somehow creates a 404 error redirecting them to the homepage. I suspect a problem with the two htaccess files not working correctly together.
Any ideas? Thanks a lot.
-
☆ A M B ☆
- 24,524 Posts
-
☆ A M B ☆
- 24,524 Posts
Maybe you need a secure download system like
http://modxcms.com/extras/package/147
I looked at it, but will it allow me to password protect the documents or just to count them and prevent access for some IPs?
You can password protect them. The files are served from a MODx document and you can protect the document just like you would any other MODx page.
I don't know if this has been covered more recently, but I'll resurect the old thread. I ran into the same problem using Evolution today and I stumbled into a solution after a snag I hit with directory permissions on some shared hosting.
Our servers are looking for a 401 Unauthorised page - and this happens not only when authentication fails but also if it's yet to be provided. It's this 401 page that isn't found, leading to a 404 and a redirect.
The fix it is to add an ErrorDocument line to the .htaccess file in the subdirectory like this:
ErrorDocument 401 /
That could also be ErrorDocument 401 /error-pages/404.html, or any path you like so long as the document exists.
I hope that's useful to someone.
I had a similar problem. My host had placed files for that in the root directory (e.g., 401.shtml, 404.shtml, etc.), but I failed to copy them into the MODX root directory. That led to some weird errors and double requests (with different rewrite results) when a page wasn't found.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/MODx.html