We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,183 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Htaccess

Hi!
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.

3
Contributors
3
Replies
6 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
kaizokupuffball
Light Poster
39 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
RewriteEngine on
RewriteRule \.txt$ /notallowed.html [F,L,NC]
pritaeas
Posting Prodigy
Moderator
9,293 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,462
Skill Endorsements: 86
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?

kaizokupuffball
Light Poster
39 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Have a look here (htaccess cheatsheet):

http://borkweb.com/story/apache-rewrite-cheatsheet

diafol
Keep Smiling
Moderator
10,664 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,513
Skill Endorsements: 57

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0652 seconds using 2.67MB