Prevent Direct Link to the Component URL

Phoca Download - download manager
Mr_Anonymous
Phoca Member
Phoca Member
Posts: 14
Joined: 27 May 2014, 19:43

Prevent Direct Link to the Component URL

Post by Mr_Anonymous »

HI,

I have installed the phoca download for Joomla 3.3. I want to prevent download access to direct link based on HTTP Referrer. I read the tips here and I have saved these files outside public_html and set the absolute path in Phoca Download settings. This doesnt give the direct link to the pdf file since its placed outside root. However, the file can still be downloaded using the components direct link. Meaning, if someone types in the url like this, they can download it even if that link is placed in another website:

Code: Select all

http://127.0.0.1/mysite/index.php/download/category/2-category-1?download=1:super-file-1
So it is still downloadable using the components direct link although the file is placed outside root. How do I make sure that the file is only downloaded if the http referrer to that component link is from my site only? I dont want to restrict only for registered users. Rather all users can download it as long as the link is from my own site. How can I do that? What am I missing here?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Prevent Direct Link to the Component URL

Post by Jan »

Hi, you need to set access rights too, so e.g. only registered user can download the file.
If you find Phoca extensions useful, please support the project
Mr_Anonymous
Phoca Member
Phoca Member
Posts: 14
Joined: 27 May 2014, 19:43

Re: Prevent Direct Link to the Component URL

Post by Mr_Anonymous »

Mr_Anonymous wrote:I dont want to restrict only for registered users. Rather all users can download it as long as the link is from my own site. How can I do that?
Hi Jan, is there a way to restrict based on http referrer instead of access rights?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Prevent Direct Link to the Component URL

Post by Jan »

Hi, such needs to be done directly on the server, I think :idea:

Jan
If you find Phoca extensions useful, please support the project
Mr_Anonymous
Phoca Member
Phoca Member
Posts: 14
Joined: 27 May 2014, 19:43

Re: Prevent Direct Link to the Component URL

Post by Mr_Anonymous »

Thank you Jan. I'll look into the .htaccess and see if its possible to do it from there.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Prevent Direct Link to the Component URL

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply