/    Sign up×
Community /Pin to ProfileBookmark

About permissions

Is there a way to give acces to a document in my website ONLY by a link in the same website?

I give an example.

I have a document named “document.pdf” in a folder named “archive”. I want it to be read or downloaded only by clicking a link in my website with the href “archive/document.pdf”, but I don’t want anybody to read the document typing in the URL bar “www.website.com/archive/document.pdf”. Is it possible to do this way? Has it something to do with the R-W-X permissions? Heeeeelp!

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@ray326Feb 17.2005 — You can only do that by interposing a server side process like CGI or a language like PHP.
Copy linkTweet thisAlerts:
@MstrBobFeb 17.2005 — [font=trebuchet ms][COLOR=royalblue]If one is using the Apache server, wouldn't one be able to accomplish something like this via .htaccess?[/COLOR][/font]
Copy linkTweet thisAlerts:
@arturionauthorFeb 21.2005 — My server supports php. I'm not able to change the options (to activate global variables, etc.), but I can upload PHP scripts to be executed.
Copy linkTweet thisAlerts:
@jeanneMar 11.2005 — I think the .htaccess is right, if you can do that. They may let you do it if you ask, or do it for you?
Copy linkTweet thisAlerts:
@ray326Mar 13.2005 — Yes, htaccess is another route, requiring an id/password to get to the document.
Copy linkTweet thisAlerts:
@the_treeMar 13.2005 — As you don't have access to you .htaccess file, I think you're best bet might be [url=http://php.net/session]PHP Sesions[/url].
Copy linkTweet thisAlerts:
@MstrBobMar 13.2005 — [font=Georgia][COLOR=royalblue]Is it really sessions or password protection he's looking for? From what you describe, I'd think you'd want to check the HTTP Referer. Are you sure you can't use .htaccess? The best thing to do is to create a file named '.htaccess' and see if it works.[/COLOR][/font]
×

Success!

Help @arturion spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...