1,105,546 Community Members

Htaccess

Member Avatar
kaizokupuffball
Light Poster
39 posts since Aug 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 
RewriteEngine on
RewriteRule \.txt$ /notallowed.html [F,L,NC]
Member Avatar
kaizokupuffball
Light Poster
39 posts since Aug 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
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?

Member Avatar
diafol
Where are my eyes?
12,985 posts since Oct 2006
Reputation Points: 1,821 [?]
Q&As Helped to Solve: 1,848 [?]
Skill Endorsements: 92 [?]
Moderator
Featured
Sponsor
 
1
 

Have a look here (htaccess cheatsheet):

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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: