Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Prevent direct access (from URL bar) to TXT file in page folder

Started by Matija Čoklica 8 years ago · 0 replies · 873 views
8 years ago

Hello!

I have premium site and within its visible content there is a link to TXT file. By clicking on that link, txt file will not be downloaded, but instead it will be opened inside current user's browser. Mentioned premium site is protected by Login plugin, so it can be viewed only by signed-in user, regardless of directly typing URL of that site in browser bar or by navigating to it from menu. AFAIK, this is not the case for media. Attribute protect_protected_page_media won't "work" when visitor directly writes a URL of TXT file in browser bar. Is there any other attribute or plugin to prevent direct access? I heard .htaccess is a way-to-go on such scenarios. If anyone can, who used such approach, give me an advice on how to configure it or even share an example of .htaccess in one of his sites, I would really appreciate it.

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago