I can't say im familiar with the .htaccess file.

I need to create a htaccess file that will redirect the user if he manually tries to open a .txt file on the server, or tries to download it (example if the user tries to navigate to www.domain.com/users/username/bio.txt, then he will get redirected)

I do not where else to post this, so please redirect me if this is the wrong thread for the topic.

Thx in advance.

Recommended Answers

Have a look here (htaccess cheatsheet):


Jump to Post

All 3 Replies

RewriteEngine on
RewriteRule \.txt$ /notallowed.html [F,L,NC]
RewriteEngine on
RewriteRule \.txt$ /notallowed.html [F,L,NC]

That was easy, thanks! xD
Could you tell me what [F,L,NC] does? What it stands for?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.