Apache .htaccess Guide, Tutorials and Articles
Username:
Password:
Register / My Account / Forgotten Password?

Forcing scripts to display as source code

(Edit this article)
If you need to display scripts as source code, instead of executing, for example to allow review, this can be achieved with the Remove Handler function
 
To enable this, create a .htaccess file following the main instructions and guidance, and include the following text:
 
RemoveHandler cgi-script .pl .cgi .php .py
AddType text/plain .pl .cgi .php .py
<- Prevent access to php.ini Ensuring media files are downloaded instead of played ->

Visitor Comments and Responses

Average Rating: 6.00 out of 10 (1 Votes)

Submit Comment/Rating

Article Rating:
Name: (optional)
Your Comment/Response: (optional)
Powered by OpenCrypt Article Manager
Table of Contents RSS Feed
1. What is .htaccess?
2. How to use .htaccess
3. Error documents
4. Redirects
5. Password protection
6. Deny visitors by IP address
7. Deny visitors by referrer
8. Hot link prevention techniques
9. Blocking offline browsers and 'bad bots'
10. DirectoryIndex uses
11. Adding MIME types
12. Enable SSI with .htaccess
13. Enable CGI outside of the cgi-bin
14. Disable directory listings
15. Setting server timezone
16. Changing server signature
17. Preventing access to your PHP includes files
18. Prevent access to php.ini
19. Forcing scripts to display as source code
20. Ensuring media files are downloaded instead of played
21. Setting up Associations for Encoded Files
22. Preventing requests with invalid characters
23. Useful Resources
 
Sponsors
Space Holder
Space Holder


Copyright © 1999 - 2008 ionix Limited. All Rights Reserved. Company Information, Affiliates

Powered by OpenCrypt Membership Software