Just a note to let everyone know that Perishable Press will be undergoing site maintenance for the next several hours. I apologize in advance for any inconvenience this might cause. Thanks for your patience ;)
After implementing any of the hotlink-prevention techniques described in our previous article, you may find it necessary to disable hotlink-protection for a specific directory. By default, htaccess rules apply to the directory in which it is located, as well as all subdirectories contained therein. There are (at least) three ways to enable selective hotlinking:
Place hotlink images in an alternate directory
This method works great if your hotlink-protection rules are located in a directory other than the site root. Simply create another directory outside of the directory containing the htaccess rules and place your hotlink-allowed images into that directory.
Create a pseudo-rewrite rule for the target directory
If your images are located within the influence of your hotlink-protection rules, and you need to enable hotlinking for a specific directory, it is possible to circumvent the anti-hotlink rewriting for that directory. In the htaccess file for the target directory, add the following, pseudo-rewrite rules 1:
Continue Reading
Last week, I finally got around to upgrading to Mint 2.14. The new version is quite impressive, and well worth the time (and cash) spent upgrading. In the process, however, one of my favorite, most heavily used bookmarklet things ceased to work.
Before the upgrade, I had been enjoying the highly useful Refresh-All bookmarklet by Jonathan Snook. Snook’s Mint-refresh bookmarklet made it super-easy to update all Mint data panels without having to refresh the entire page. Using the bookmarklet is much faster that reloading the browser, and there is even an alternate version that will refresh panels automatically at user-specified intervals.
Continue Reading
In this brief tutorial, we are going to enable users to access any file or directory of a site that is password-protected via htaccess. There are many reasons for wanting to employ this technique, including:
- Share public resources from an otherwise private site
- Enable visitors to access content during site maintenance
- Testing and formatting of layout and design during development
As a webmaster, I have used this technique on several occasions. This trick works great for allowing access to any number of files, directories, and/or combination of both. We will begin with a generalized example, proceed with an explanatory discussion, and wrap things up with a couple of useful modifications.
Continue Reading
Okay, I realize that the title sounds a bit odd, but nowhere near as odd as my recent discovery of Slurp ignoring explicit robots.txt rules and digging around in my highly specialized bot trap, which I have lovingly dubbed “the blackhole”. What is up with that, Yahoo!? — does your Slurp spider obey robots.txt directives or not? I have never seen Google crawling around that side of town, neither has MSN nor even Ask ventured into the forbidden realms. Has anyone else experienced such unexpected behavior from one the four major search engines? Hmmm.. let’s dig a little further..
Here is the carefully formulated, highly specific, properly placed robots.txt rule that explicitly and strictly forbids all agents from accessing my blackhole bot trap:
Continue Reading
When I wrote my article, Stupid htaccess Tricks, a couple of years ago, hotlink-protection via htaccess was becoming very popular. Many webmasters and bloggers were getting tired of wasting bandwidth on hotlinked resources, and therefore turned to the power of htaccess to protect their content. At that time, there were only a couple of different hotlink-protection methods available on the internet, and the functional difference between them was virtually insignificant. All that was necessary for up-and-coming bloggers-slash-site-administrators to eliminate leaking bandwidth and stolen resources was a relatively straightforward copy-&-paste procedure. Implementing the de facto htaccess hotlink protection code required a simple binary decision: “do you want hotlink-protection or not?”
These days, however, things are not so simple. Today, if you do a search on the internet for “htaccess hotlink protection”, you’ll get the phone book. There are countless mutations of the once tried-and-true htaccess code. There have been significant improvements, but there is also plenty of noise and error lurking among the countless techniques. These days, protecting your site’s assets and conserving bandwidth requires either trusting the first htaccess trick you find, or performing a mind-numbing and time-consuming amount of research to find the htaccess anti-hotlinking strategy that’s perfect for you and your domain. With this article, I do the grunt work for you — analyzing, deconstructing, and cannibalizing a contemporary collection of hotlink-protection methods to create the ultimate htaccess Anti-Hotlinking Strategy.
Continue Reading
Beginning with this article, I am serving up a short series of unobtrusive JavaScript functions that I use to enhance the functionality of Perishable Press. In this post, I present a comprehensive JavaScript method of opening external links in new windows (or tabs, depending on the browser).
One way of opening links in new windows is to insert the HTML target="_blank" attribute into all necessary anchor elements (<a href=""></a>). This method works well, but generates validation errors when used with XHTML-Strict doctypes.
A better solution is to employ some unobtrusive JavaScript to progressively enhance your documents with “blank-target” functionality. Using the following code, 99% of your visitors (those with JavaScript) will enjoy external links opening in new windows, while the remaining 1% of your audience (those without JavaScript) will enjoy your site without even realizing they are missing out on those wonderful blank-targeted links. It’s a “win-win” situation ;)
Continue Reading
I don’t know about you, but ever since the 2007 change in daylight savings time, my installation of Windows XP has had a difficult time (so to speak) maintaining consistently accurate time. Ever since the change, Windows XP has been randomly resetting its clock (as indicated via the Taskbar) to display time incorrectly. Specifically, WinXP will automatically (i.e., without user intervention) set the time to be one hour earlier than the actual time. For example, if the time is actually 3:00pm, Windows will suddenly display the time as 2:00pm. This has caught me off-guard on several occasions now, as I would work with an incorrect assumption concerning the time, only to find myself running an hour late to an appointment. Clearly, something needs to be done..
The first thing that comes to mind is to switch operating systems. For reasons that extend far beyond wonky time-keeping, I have been wanting to switch to open-source for years. If you have the luxury, time, and resources to accommodate such a switch, then perhaps Linux or Mac will serve you better with much more than the keeping of accurate time.
Continue Reading
Hammer down
a business pile
dual-action cleanse,
healthy movements daily
In this article, I present several heavily commented examples of WordPress loops. I have found that many readers appreciate these types of loop examples, as it helps them to understand how the loop works while enabling them to easily copy, paste, and adapt the code for their own purposes. In our first example, we examine a basic WordPress loop. When implemented, this loop will display “x” number of posts, where “x” represents the number specified via the WordPress Admin reading options panel. To use this code, simply copy & paste into your WordPress theme’s index.php file 1 and customize accordingly.
Continue Reading
By now, everyone is familiar with the Yahoo Developer Network’s 14 “best-practices” for speeding up your website. Certainly, many (if not all) of these performance optimization tips are ideal for high-traffic sites such as Yahoo or Google, but not all of them are recommended for smaller sites such as Perishable Press. Nonetheless, throughout the current site renovation project, I have attempted to implement as many of these practices as possible. At the time of this writing, I somehow have managed to score an average 77% (whoopee!) via the YSlow extension for Firebug.
Of the handful of these tips that I am able (or willing) to follow, number 6 — move scripts to the bottom — is definitely one of the easiest. The reason for doing this is at least twofold:
[…] it’s better to move scripts from the top to as low in the page as possible. One reason is to enable progressive rendering, but another is to achieve greater download parallelization.
— Yahoo! Developer Network
Many people mistakenly assume that the <script> element (and associated contents) must be located squarely in the document <head>, however, this simply isn’t true. As outlined in the official HTML 4.01 Document Type Definition and also in the official XHTML 1.1 Document Type Definition, the <script> element is allowed:
Continue Reading
Now that my recent site overhaul project is nearly complete, I thought it would be useful to share my carefully developed “plan of attack.” The following seven-step strategy is designed to facilitate the entire renovation by logically ordering events and breaking down complex tasks. Upon execution, the following plan is designed to improve overall site functionality, presentation and structure, while factoring in several critical parameters:
- Modular time organization — due to my hectic schedule, it is necessary to break large projects down into manageable chunks.
- Separation of main site from test site — I need a clear distinction between Perishable Press and my many test blogs, pages, and projects.
- Separation of main content from tangential content — distinguishing between main content and other material (e.g., private content, FTP files, etc.) is critical.
- Facilitation of future WordPress upgrades — keeping up with WordPress is important. Before the site overhaul, upgrading was nearly impossible. In fact, the primary thrust of this site makeover is aimed at making it easier to stay current with WordPress.
Thus far, adhering to this plan has helped to eliminate confusion by simplifying an otherwise convoluted project. With this plan firmly in mind, stepping through the entire process happened in a clear, nearly mechanical fashion. Without a doubt, being prepared provided an expediency and thoroughness that would have otherwise remained elusive. Is this the “perfect” plan for renovating a rather large, preexisting site? Probably not. Will you learn something about preparing for and executing WordPress and other site upgrades by reading it? Probably. I suppose, in any case, that even if readers find the proceeding plan all but useless, posting it online is great for prosperity and may even serve useful as future reference material. So, without further ado, here is an outline of the activity recently unfolding behind the scenes here at Perishable Press.
Continue Reading
“Oh no, not again!” It looks like another one of my non-existent bank accounts has been blocked at Bank of America. But that’s cool, because I like, totally graduated from third grade. Knowing best for all grammar and words in email. Let’s examine yet another idiotic phishing attempt, shall we? First, let’s have a look at the full-meal deal (sans bank logos, links, and other forged minutia):
From : abuse@bankofamerica.com
Date : Wednesday, November 07, 2007 6:19 AM
To : none
Subject : Online Banking Alert
------------------------------
Your Online Banking is Blocked
Because of unusual number of invalid login attempts on you account,
we had to believe that, their might be some security problem on you
account. So we have decided to put an extra verification process to
ensure your identity and your account security. Please click on
sign in to Online Banking to continue to the verification process
and ensure your account security. It is all about your security.
Thank you, and visit the customer service section.
------------------------------
Yes indeed, another amazingly pathetic phishing attempt. To quote an old intergalactic smuggler:
“What an incredible smell you’ve discovered..”
First of all, it needs to be said that, especially in our modern, “phishing-aware” world, it is absolutely critical for would-be phishers to comprehend thoroughly the language in which their bait will be delivered. This is especially true when it comes to the emulation of formal communication from legitimate business establishments such as banks, online shops, and governmental offices.
Continue Reading
![Happy Second Anniversary! [ Image: Psychedelic Balloon Scene ]](http://perishablepress.com/press/wp-content/images/2007/misc-chunks/second-anniversary.jpg)
To celebrate the second anniversary of Perishable Press, I am taking the day off! To fill the virtual cyber-vacuum left in the absence of today’s regularly scheduled post, allow me to highlight a few of my favorite articles from our second year online:
Continue Reading
Two weeks ago, I decided to completely overhaul Perishable Press. The decision came after several months of smooth sailing with excellent site performance, an optimized theme, plenty of visitors, and even a comfortable posting schedule. All things considered, everything was peachy keen — until I began reflecting on the “big picture,” meditating upon certain aspects that are frequently taken for granted or simply overlooked during periods of hectic operation and maintenance. For example, while troubleshooting htaccess and PHP errors, webmasters generally don’t take the time to meditate on the structural and functional integrity of their overall site configuration.
Fortunately, I recently found the time to contemplate Perishable Press from a broader perspective, rethinking everything from themes and plugins to organizational architecture and permalinks. As I approach the completion of the most comprehensive site renovation ever, many significant improvements are currently underway. Here is a summary of the primary changes involving site structure, presentation, functionality and performance:
Continue Reading