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