A Web Development Blog Focused on Code and Technology
Currently Browsing: Home » Posts tagged 'htaccess'
Posts Tagged ‘htaccess’
When we browse the web, we click on links. That’s what makes the web a web – the links between pages. Sometimes, those links lead us not to pages, but to files. Many types of files pop up dialog boxes prompting downloads – executables, videos, etc.
However, certain filetypes, thanks to modern web browsers, are rendered as an in-browser page, such as images, PDFs, and MP3s. While this may be a convenience, at times we may wish to force the user to download the files, not just view them in their browser.
In this article I will show two easy ways to do this. The first is using .htaccess, and the second is using PHP.
Have you ever had to deal with a sloppy site? Maybe it was when you were working with a client. Or could it be your own site, which you formatted poorly because of inexperience? Regardless, there is a simple yet efficient way to make your site based completely off a template. All it requires is a bit of htaccess and some PHP.
Time for some incentive
This will be a multi-part tutorial in which we explain how to completely transform your site into an organized beast. Today’s section will focus on a few lines of .htaccess that you will soon come to love. But, before we begin, let’s go over a few advantages and some incentive for creating a template-focused site.
Many hosts have a set bandwidth clients can use. In this day and age, files are getting larger and heavier, but bandwidth costs aren’t getting much cheaper. So, one of the best and easiest things to do is to GZip.
CSS files for larger sites can become pretty large themselves. Gzipping or compressing these files has shown to provide a reduction in the neighborhood of 70-80% of the original file size, a fairly significant ‘weight loss’.