ASPit - Totally ASP JSit - Totally JavaScript
Search PHPit

Use this textbox to search for articles on PHPit. Seperate keywords with a space.

Advertisements

.htaccess Wrappers with PHP

(Page 1 out of 6)

HTACCESS is a remarkable tool you can use for password protection, error handling (like custom 404 pages), or HTTP redirects. It can also be used to transform whole folders in seconds: adding headers to all your HTML documents, watermarking all your images, and more.

A wrapper is like a middleman. Using htaccess you can tell your web server to "forward" certain files to PHP scripts of yours. When a visitor tries to load an image in their browser, you could activate a script that adds a watermark to the image. When an HTML page is loaded you could query an IP-to-country database and have your HTML pages translated into the native language of your visitor's country-of-origin.

Every file in a folder, or all files of a certain type in a folder, can be instructed to go through a PHP script.

Next: Tortilla Wrap »



Leave a Reply

About the author
Dennis Pallett is the main contributor to PHPit. He owns several websites, including ASPit and Chill2Music. He is currently still studying.
Article Index
  1. Introduction
  2. Tortilla Wrap
  3. Shrink-Wrap
  4. "Gift Wrapping" Your Output
  5. The best thing since bubble wrap
  6. The Wrap-Up
Bookmark Article
Download Article
PDF
Download this article as a PDF file