Web Development

  Homes arrow Web Development arrow Page 6 - HTACCESS Wrappers with PHP
 Webmaster Tools
Base64 Encoding 
Browser Settings 
CSS Coder 
CSS Navigation Menu 
Datetime Converter 
DHTML Tooltip 
Dig Utility 
DNS Utility 
Dropdown Menu 
Fetch Content 
Fetch Header 
Floating Layer 
htaccess Generator 
HTML Encoder 
HTML Entities 
IP Convert 
Meta Tags 
Password Encryption
Password Strength
Pattern Extractor 
Ping Utility 
Pop-Up Window 
Regex Extractor 
Regex Match 
Scrollbar Color 
Source Viewer 
Syntax Highlighting 
URL Encoding 
Web Safe Colors 
Forums Sitemap 
Weekly Newsletter
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Contact Us 
Site Map 
Privacy Policy 
  >>> SIGN UP!  
  Lost Password? 

HTACCESS Wrappers with PHP
By: Jase Dow
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2

    Table of Contents:
  • HTACCESS Wrappers with PHP
  • That's all you've...
  • That contains the...
  • The same basic...
  • If our wrapper...
  • Without HTTP compression...
  • A practical way...
  • I've included several...
  • You could also...

  • Rate this Article: Poor Best 
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article




    HTACCESS Wrappers with PHP - Without HTTP compression...

    (Page 6 of 9 )

    Without HTTP compression it took 5 and a half minutes to download. With the compression, only 2 minutes. Internet Explorer told me the download was going at 20 KB per second, impossible with a dialup connection... but since the file was zipped, I really was downloading 20 KB a second (once the data was decompressed on my end) over a 5 KB per second connection.

    Though HTTP compression will work on sounds, video, and images, the space you save is negligible, usually only a few bytes. These sorts of media are already heavily compressed so zipping makes almost no difference. This is why we've told htaccess to only use compression on text and HTML, because it's with human languages like English where a lot of repetition occurs, which means more information can be compressed.

    Not all browsers support HTTP compression, but ob_gzhandler() figures out if a browser can support HTTP compression. If the browser doesn't, the original file is displayed, no harm done.

    You can get a copy of this sample script at: http://www.jumpx.com/tutorials/wrapper/compress.zip

    Both of these scripts I've created for you will work only on static files, files that actually exist such as images or HTML files. If you tried to apply these wrappers as-is to PHP scripts, Perl scripts or even HTML pages that use SSI. If your whole site is run by a single script it's a better idea to hard-code these things right in, anyway.


    This last demonstration of an htaccess wrapper is something that I think most people with content sites have a use for. On the Internet, people steal stuff. Theft of HTML source code is a nuisance, sure, but the lifting of images is more common. Someone likes a logo on your page, or an e-book cover, or a picture of a physical product you're selling, and it becomes theirs to use.

    More Web Development Articles
    More By 359



    - On Page SEO for New Domains
    - Improve Your Site`s Speed
    - Safari Books Online Review
    - Creating an Estore From the Ground Up
    - Most Common SEO Mistakes Developers Make
    - Making the Most of Your Titles and Meta Desc...
    - Five Ways Using Flash Can Damage Your Site
    - A Web Designer`s Guide to Colors
    - Use Webstarts to Create a Free Site
    - More Than Just Looks. How Your Web Design C...
    - How to Design Content Pages
    - Mint Review
    - Make Your WordPress Website Look Professional
    - How to Create a Mobile Web Site
    - Meta Tags: Still Useful?

    Developer Shed Affiliates


    © 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap