Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get my website to display a .c file instead of trying to make the user download it?

Tags:

apache

My webserver is Apache (I don't have admin rights over it though).

In my www/ directory, I have some .c files I'd like to display to the user to view in their browser.

Currently though, the website tries to make the user download the files instead of simply displaying them.

How can I fix this? Is there some sort of .htaccess trick?

like image 490
samoz Avatar asked Jul 25 '09 14:07

samoz


1 Answers

Putting:

AddType text/plain .c

in the .htaccess should work.

like image 101
Mehmet Ergut Avatar answered Oct 13 '22 18:10

Mehmet Ergut