Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

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

Started by Matija Čoklica 8 years ago · 0 replies · 556 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 Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago