Support

Admin Tools

#10110 Need to create a custom htaccess rule for directory with plugin only access

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by user51195 on Sunday, 20 November 2011 16:33 CST

user51195
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? yes
Have I searched the forum before posting? yes
Have I read the documentation before posting (which pages?)? all relating to htaccess within the admin tools documentation
Joomla! version: 1.6.4
PHP version: 5.2.17
MySQL version: 5.1.56
Host: private server through underhost
Admin Tools version: 2.1.11


Description of my issue:
I am playing flash files through a plugin player (JoomlaXTC VTube Pro) that are intended for registered users only (the player and articles that it is published in are set for registered users only), the files are stored in a directory in publichtml. I would like to make a htaccess rule that prevents users from accessing the directory except through the player. Can someone help me with the custom code? (I don't have much htaccess experience)
Or is there a better method for protecting the directory?

Thanks

nicholas
Akeeba Staff
Manager
Hi,

This is not possible. The reason is that the player is a Flash file running on your clients' browser. It will then request the video file through HTTP, without going through Joomla!, without any indication of the user's ID and therefore making it completely possible to filter the request based on the user's subscription status. You are essentially asking for a car which can only be driven by its owner, without the owner having a key / keycard and without supplying any identification of himself whatsoever. That would be impossible, wouldn't it?

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51195
Nicholas, Thanks for your reply. Do you have a suggestion how I can secure the files from guest level access? I can change the type and display method if needed.

nicholas
Akeeba Staff
Manager
Unless it's a self-developed application, you can't do that. Ideally, the files should be stored in an off-site directory or a directory which is not directly web-accessible. Then, the player would request a URL which goes through a custom Joomla! components, something like index.php?option=com_customvideo&view=servefile&id=1234 which would check if the current user has adequate privileges to download the video file for the video with ID 1234 and, if so, pass through the video file to the browser. However, given the setup you described, I guess that what I just mentioned is most likely next to impossible for you, so the answer is no, you can't do that.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user51195
Thanks for your time. That is a good suggestion - and no, it is not imposable for me - that may be the direction I need to go, although I was trying to avoid it.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!