Articles tagged with “mod_rewrite

Redirecting Subdirectories to the Root Directory via HTAccess
One of the most useful techniques in my HTAccess toolbox involves URL redirection using Apache’s RedirectMatch directive. With RedirectMatch, you get the powerful regex pattern matching available in the mod_alias module combined with the simplicity and effectiveness of the Redirect directive. This hybrid functionality makes RedirectMatch the ideal method for highly specific redirection. In this tutorial, we will explore the application of RedirectMatch as it applies ...
Redirect All Requests for a Nonexistent File to the Actual File
In my previous article on redirecting 404 requests for favicon files, I presented an HTAccess technique for redirecting all requests for nonexistent favicon.ico files to the actual file located in the site’s web-accessible root directory: # REDIRECT FAVICONZ RewriteCond %{THE_REQUEST} favicon.ico [NC] RewriteRule (.*) http://domain.tld/favicon.ico [R=301,L] As discussed in the article, this code is already in effect here at ...
Stop the Madness: Redirect those Ridiculous Favicon 404 Requests
For the last several months, I have been seeing an increasing number of 404 errors requesting “favicon.ico” appended onto various URLs: http://perishablepress.com/press/favicon.ico http://perishablepress.com/press/2007/06/12/favicon.ico http://perishablepress.com/press/2007/09/25/absolute-horizontal-and-vertical-centering-via-css/favicon.ico http://perishablepress.com/press/2007/08/01/temporary-site-redirect-for-visitors-during-site-updates/favicon.ico http://perishablepress.com/press/2007/01/16/maximum-and-minimum-height-and-width-in-internet-explorer/favicon.ico When these errors first began appearing in the logs several months ago, I didn’t think too much of it — “just another idiot who can’t find my site’s favicon..” As time went on, however, the frequency and variety of these misdirected requests continued to increase. A bit frustrating perhaps, but not serious enough to ...
Perishable Press HTAccess Spring Cleaning, Part 2
Before Summer arrives, I need to post the conclusion to my seasonal article, Perishable Press HTAccess Spring Cleaning, Part 1. As explained in the first post, I recently spent some time to consolidate and optimize the Perishable Press site-root and blog-root HTAccess files. Since the makeover, I have enjoyed better performance, fewer ...
Series Summary: Building the 3G Blacklist
In the now-complete series, Building the 3G Blacklist, I share insights and discoveries concerning website security and protection against malicious attacks. Each article in the series focuses on unique blacklist strategies designed to protect sites transparently, effectively, and efficiently. The five articles culminate in the release of the next generation 3G Blacklist. For the record, here is a quick summary of the entire Building the 3G Blacklist series:...
Perishable Press HTAccess Spring Cleaning, Part 1
While developing the 3G Blacklist, I completely renovated the Perishable Press site-root and blog-root HTAccess files. Since the makeover, I have enjoyed better performance, fewer errors, and cleaner code. In this article, I share some of the changes made to the root HTAccess file and provide a brief explanation as to their ...
Perishable Press 3G Blacklist
After much research and discussion, I have developed a concise, lightweight security strategy for Apache-powered websites. Prior to the development of this strategy, I relied on several extensive blacklists to protect my sites against malicious user agents and IP addresses. Over time, these mega-lists became ...
Building the 3G Blacklist, Part 5: Improving Site Security by Selectively Blocking Individual IPs
In this continuing five-article series, I share insights and discoveries concerning website security and protecting against malicious attacks. Wrapping up the series with this article, I provide the final key to our comprehensive blacklist strategy: selectively blocking individual IPs. ...
Building the 3G Blacklist, Part 4: Improving the RedirectMatch Directives of the Original 2G Blacklist
In this continuing five-article series, I share insights and discoveries concerning website security and protecting against malicious attacks. In this fourth article, I build upon previous ideas and techniques by improving the directives contained in the original, 2G Blacklist. Subsequent articles will focus on key blacklist strategies designed ...
Building the 3G Blacklist, Part 3: Improving Site Security by Selectively Blocking Rogue User Agents
In this continuing five-article series, I share insights and discoveries concerning website security and protecting against malicious attacks. In this third article, I discuss targeted, user-agent blacklisting and present an alternate approach to preventing site access for the most prevalent and malicious user agents. Subsequent articles will focus on ...
Building the 3G Blacklist, Part 2: Improving Site Security by Preventing Malicious Query-String Exploits
In this continuing five-article series, I share insights and discoveries concerning website security and protecting against malicious attacks. In this second article, I present an incredibly powerful method for eliminating malicious query string exploits. Subsequent articles will focus on key blacklist strategies designed to protect your site ...
Building the 3G Blacklist, Part 1: Improving Site Security by Recognizing and Exploiting Server Attack Patterns
In this series of five articles, I share insights and discoveries concerning website security and protecting against malicious attacks. In this first article of the series, I examine the process of identifying attack trends and using them to immunize against future attacks. Subsequent articles will focus on key blacklist strategies designed to protect your site transparently, effectively, and efficiently. At the conclusion of the ...
How to Block Proxy Servers via htaccess
Not too long ago, a reader going by the name of bjarbj78 asked about how to block proxy servers from accessing her website. Apparently, bjarbj78 had taken the time to compile a proxy blacklist of over 9,000 domains, only to discover afterwards that the formulated htaccess blacklisting strategy didn’t work as expected: deny from proxydomain.com proxydomain2.com Blacklisting proxy servers by blocking individual domains seems like a futile exercise. Although there are ...
2G Blacklist: Closing the Door on Malicious Attacks
Since posting the Ultimate htaccess Blacklist and then the Ultimate htaccess Blacklist 2, I find myself dealing with a new breed of malicious attacks. It is no longer useful to simply block nefarious user agents because they are frequently faked. Likewise, ...
Three Ways to Allow Hotlinking in Specific Directories
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 ...
Stupid htaccess Trick: Enable File or Directory Access to Your Password-Protected Site
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 ...
Creating the Ultimate htaccess Anti-Hotlinking Strategy
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 ...
WordPress Lessons Learned, Part 1: Permalink Structure
While planning my current site renovation project, I considered changing the format of my permalinks. Reasons for modifying the permalink structure of a site include: Optimizing URLs for the search engines Simplifying URL structure for improved readability Removing the implication that your site content is somehow organized chronologically Removing other unwanted organizational implications (e.g., categorically, topically, etc.) Like many people who configured WordPress permalinks a couple of years ago, ...
Ultimate htaccess Blacklist 2 (Compressed Version)
[ Keywords: htaccess, rewrite, blacklist, block, deny, spam, spammers, scrapers, rippers ] In our original htaccess blacklist article, we provide an extensive list of bad user agents. This so-called “Ultimate htaccess Blacklist” works great at blocking many different online villains: spammers, scammers, scrapers, scrappers, rippers, leechers — you name it. Yet, despite its usefulness, there is always room for improvement. For example, as reader ...
htaccess Combo Pack: WordPress Permalinks and non-www Redirect
WordPress users employing permalinks via htaccess to optimize their dynamic URLs transform complicated-looking links such as: http://example.com/blog/index.php?page=33 ..into search-engine friendly links such as: http://example.com/blog/post-title/ Every rewritten URL relies on a common set of htaccess rules to transform the links. The htaccess rules for all WordPress permalinks look like this for root WP installations: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
Temporary Site Redirect for Visitors during Site Updates
[ Keywords: temporary, redirect, htaccess, php, site, maintenance, 403, 503, http, status, code ] In our article Stupid htaccess Tricks, we present the htaccess code required for redirecting visitors temporarily during periods of site maintenance. Although the article provides everything needed to implement the temporary redirect, I think readers would benefit from a more thorough examination of the process — nothing too serious, just ...
Permanently Redirect a Specific IP Request for a Single Page via htaccess
Not the most interesting title, but “oh well”.. Recently, a reader named Alison left a comment requesting help with a particular htaccess trick. She wanted to know how to permanently redirect (301) all requests for a specific page when requested from a specific IP address. In other words, when a visitor coming from 123.456.789 requests the page requested-page.html, the visitor will be redirected to just-for-you.html. All visitors not ...
Allow Google Reader to Access Hotlink-Protected Images
[ google, reader, mobile, htaccess, allow, access, hotlink, protection, images, rewrite ] In our previous article, we explain the process of allowing Feedburner to access your hotlink-protected images. The article details the entire process, which covers the basics of hotlink protection and involves adding several lines of code to your htaccess file. In this article, we skip the detailed explanations and ...
Allow Feedburner Access to Hotlink-Protected Images
[ Keywords: feedburner, htaccess, allow, access, hotlink, protection, feed, images, rewrite ] Recently, we installed and configured the excellent WordPress Feedburner plugin by the venerable Steve Smith 1. The plugin basically redirects our various WordPress-powered content feeds to Feedburner, which then delivers them to subscribers. This method enables us to take advantage of Feedburner’s excellent statistical tools. Further, all of the action ...
Major Problem with cPanel Hotlink Protection and htaccess
[ Keywords: cpanel, hotlink, protection, htaccess, rewrite, rules, problem, bug, issue ] There is a major problem with the “Hotlink Protection” feature of cPanel. To summarize the issue, allow me to quote a recent email sent to a completely unresponsive tech support department: ...The problem is that if I try to include any rewrite rules for permalinks, hotlinking, or blocking spambots, cPanel automatically enables its “Hotlink Protection” feature. And, even worse, it automatically adds every URL from every ...
Ultimate htaccess Blacklist
[ Keywords: htaccess, rewrite, blacklist, block, deny, spam, spammers, scrapers, rippers ] For those of us running Apache, htaccess rewrite rules provide an excellent way to block spammers, scrapers, and other scumbags easily and effectively. While there are many htaccess tricks involving blocking domains, preventing access, and redirecting traffic, ...
Compressed JavaScript Compression
[ Keywords: javascript, compression, compress, php, htaccess, gzip, ob_gzhandler ] In this article, we extrapolate our favorite CSS-compression technique for JavaScript. Below, we outline the steps required to auto-compress your JavaScript documents via gzip and PHP. Two different compression methods are presented. The first method does not require htaccess, but rather involves the manual editing of JavaScript files. The second method employs htaccess to do ...
Fast, Effective PHP Compression
PHP compression is an excellent method of conserving bandwidth and reducing client download times. We have already discussed an excellent method for CSS compression, and in this article we share a super-easy technique for compressing all PHP content without editing a single file. Using two PHP files and two corresponding lines of .htaccess, it is possible to compress your PHP files via gzip-encoding. Browsers and other user-agents capable of ...
Automatic Language Translation Methods
As you may have noticed, Perishable Press recently added automatic language translation to each of our articles. The free, automatic translations are available as a series of image links (via corresponding country flag icons) next to each article’s individual post view. We have found that providing this free service is important as many of our visitors come from countries other than the United States, and therefore may be unable to read our articles as presented in the ...
Roll your own Apache Rewrite Log
Note to self: Here is the .htaccess code for creating an Apache Rewrite log. This is definitely helpful for testing .htaccess rewrite rules, permalinks, etc. Update: as jc points out in the comments section, Apache versions 2.2 or better no longer allow RewriteLog directives in htaccess files. For these versions, it is necessary to coordinate logging through the server configuration file or via virtual host. For more information, check the source. For ...
Block Spam by Denying Access to No-Referrer Requests
Credit for this trick goes to shoemoney.com. What we have here is an excellent method for preventing a great deal of blog spam. With a few strategic lines placed in your htaccess file, you can prevent spambots from dropping spam bombs by denying access to all requests that do not originate from your domain. How does it work? Well, when a legitimate user (i.e., not a robot, etc.) decides to leave a comment on your blog, ...
Stop Bitacle from Stealing Content
If you have yet to encounter the content-scraping site, bitacle.org, consider yourself lucky. The scum-sucking worm-holes at bitacle.org are well-known for literally, blatantly, and piggishly stealing blog content and using it for financial gains through advertising. While I am not here to discuss the legal, philosophical, or technical ramifications of illegal bitacle behavior, I am here to provide a few critical tools that will help ...
Compressed CSS Compression
In this article, we have consolidated the priceless information provided in fiftyfoureleven.com’s fine post, The Definitive Post on Gzipping your CSS, which discusses two practical methods for compressing CSS documents. Complete and utter credit for the contents of this article is hereby attributed to fiftyfoureleven.com. Method One Overview: This method involves adding a small PHP script to your CSS document and replacing its .css extension ...
The htaccess Rules for all WordPress Permalinks
Note: this article specifically applies to WordPress version 2+ running on Apache servers. We recently performed a series of tests on a fresh installation of WordPress 2.0.2 to determine the exact htaccess rewrite rules that WordPress writes to its htaccess file for various permalink configurations. Under the WP admin option menu, WordPress lists four choices for permalink structure: Default: http://perishablepress.com/press/?=123 Date and name based: http://perishablepress.com/press/index.php/2006/06/14/sample-post/ Numeric: http://perishablepress.com/press/index.php/archives/123 Custom: /%year%/%monthnum%/%day%/%postname%/ The "default" option is to not use permalinks. The "date and name based" setting ...
Stupid htaccess Tricks
Welcome to Perishable Press! This article, Stupid htaccess Tricks, covers just about every htaccess “trick” in the book, and is easily the site’s most popular offering. In addition to this htaccess article, you may also want to explore the rapidly expanding htaccess tag archive. Along with all things htaccess, Perishable Press also focuses on ...

Contact Perishable Press

  • Contact Jeff via form

Search Perishable Press

About Perishable Press

Perishable Press is the virtual playground of Jeff Starr — visionary, founder and lead developer of Monzilla Media, a small web and graphic design company in the lush desert oasis of Moses Lake, Washington. Perishable Press features articles and tutorials on many aspects of digital design..

Read more..

Perishable on Twitter

Laguna Sunrise, for those who know

Perishable on Tumblr

How to Close your Windows Live ID and Hotmail Account

Sunday, 9 November 2008, 6:06 pm

After deciding to stop using Hotmail, I went ahead and tried to close my newer Hotmail accounts. Unfortunately, the process of closing the accounts was a dreadfully convoluted experience, mostly due to the fact that these newer Hotmail accounts are acutally two accounts in one: one is associated with a Windows Live Hotmail account, and the other associated with a Windows Live ID account.

Whatever. After spending twenty minutes trying to figure out how to close the account(s), I decided I had better share the information for future reference. I mean, for crying out loud, Microsoft has convoluted the process to the point of absurdity. It’s like going on a damn treasure hunt! Don’t believe me? Check it out:

Login to your Hotmail account. In the upper right-hand corner, click on “Options” and then on the “More Options” link in in the drop-down panel. Then, under the “Manage your account” section, click on “View and edit your personal information”. From there, click on “Settings” in the left sidebar. Under “Additional options”, click on “Close account”. But wait, you’re not done yet!

On the “Are you sure you want to close your account” page, read everything and then enter your password for verification. If the Live ID account was not associated with a Hotmail account, you should see a success message. If your account was associated with a Hotmail account, you will see a message that says: “Cannot close your account”. Read the paragraph; in it, you will find a link to close your associated Microsoft Live Hotmail account. Click it.

The next screen gives a final warning that you are about to close your Windows Live Hotmail account (as if you didn’t know by now!). Read everything and then click “Close account” to finally close the damn account. And, believe it or not, that’s all there is to it! ;)

Goodbye, Hotmail

Sunday, 9 November 2008, 5:15 pm

Over the years, I have accumulated a large number of free Hotmail accounts. Several of these accounts were created over seven years ago, long before Microsoft made their first major overhaul to the Hotmail service. The overhaul happened quietly around five years ago (if I remember correctly), and directly affected the way in which all future Hotmail accounts operated.

One of the differences between the (very) old accounts and those established after Microsoft changed everything, is the way in which Thunderbird (and various other open-source email applications) is able to process emails from either type of account. For some reason, all of my old Hotmail accounts are processed perfectly well from within Thunderbird; however, those accounts created within the last several years do not play nice at all.

Unlike the older accounts, which are completely synchronized and integrated into Thunderbird, the newer accounts continually throw errors whenever they are checked for new email. These errors are usually associated with good ‘ol Hotmail not accepting any preset passwords, which must be re-entered manually every time email is checked. Needless to say, this behavior is very inconvenient. Meanwhile, the older accounts function flawlessly.

To get the Hotmail accounts to work at all with Thunderbird, two extensions are required, Webmail and its Hotmail-specific add-on. These two extensions enable users to integrate and process their Hotmail accounts along with all of their other email accounts. At first, the Webmail extensions worked perfectly with all Hotmail accounts; then, after a year or so, the newer Hotmail accounts stopped working. After upgrading the Webmail extensions, the newer Hotmail accounts would work, but then another year or so later, the same thing would happen all over again.

Occasionally, I have been able to get the newer Hotmail accounts to work by rolling back the Webmail extensions to previous versions, but this does not always work. Frankly, I suspect that the good ‘ol boys down at the Hotmail factory purposely tweak the system settings such that Hotmail is incompatible with free, open-source email applications like Thunderbird. I don’t know, but one thing is certain, the changes are happening on the Hotmail side of the fence, and they are changing their settings either deliberately or without concern for non-Outlook users.

So, as I find this cycle having come full-circle again, I am once again unable to check emails on newer Hotmail accounts. The bad news is that I am plumb out of previous Webmail extensions to try, and there aren’t any new versions to check out. So, as of today I am officially dumping all of my newer Hotmail accounts. I no longer have the patience or free time to spend fiddling things, trying to second-guess periodic changes on the Hotmail server. I will certainly keep the older accounts for as long as they continue to work, but the newer accounts are just not worth the effort. So, goodbye, Hotmail, I will never open another account with you again.

Transparent Division Recipe

Wednesday, 15 October 2008, 7:59 pm

I am getting so old that I need to make recipes of my design stunts so I don’t have to relearn them from scratch every time. Sad, but so are a lot of things..

In any case, here is the basic procedure for creating the transparent panels used in my current (Quintessential) design:

  1. Open main design template
  2. Verify proper widths via existing images
  3. Create guides according to desired width(s)
  4. Create a rounded-corner vector shape of 10-pixel radius
  5. Rasterize vector shape
  6. Set outer-glow layer style (normal, 33, 3, 7)
  7. Create new empty layer and merge with panel layer
  8. Magic-wand select panel area at 1%, no anti-aliasing
  9. Add layer mask to reveal all
  10. Ctrl+Gradient tool from panel top to desired fade
  11. Duplicate layer as new document
  12. Crop and match desired size

From there, it should be self-explanatory. If not, perhaps it’s time to pursue an alternate line of employment..

Tons of Firewalls

Tuesday, 7 October 2008, 1:45 am

Recently overheard on conservative talk radio (instructing listeners how to obtain a free promotional video from their new website):

“This website has tons and tons of firewalls, so you have to use your real email address to download the video..”

The Quiet Search Revolution

Monday, 6 October 2008, 12:15 pm

Just a thought.. As awesome as Google is these days, it would suck if they ended up owning the entire search-engine business. When they get to the point where all competition is impossible (due to their sheer size, financial resources, media influence, etc.), how many alternate search engines will have the resources for continuous improvement and top-quality search results? When this happens, we will have no choice but to do exactly what Google tells us to do.

As deeply ingrained as it is for everyone to instinctively and unthinkingly turn to Google for their search activity, it is time to leave a few alternate search tabs open for as much use as possible. Instead of using Google just because that’s what you always do, try your search on MSN, Yahoo, Ask, or any of the other independent search engines instead. Sharing traffic with other search engines is a nice, quiet way to keep the competitive spirit alive and well in the search-engine business.

Read more on Tumblr..

Subscribe to Comments Recent Dialogue

  • Catania Escort: gvumc xdpys cpyxitb...
  • Chris: Hey guys, thanks for getting back to me. I just tried it out using a new theme and it seems to be working fine so far! If I run into ...
  • Michel: Hi, Thanks for the Tips. The RedirectMatch 403 \/\/ do not work on this attack: http://www.mydomainname.com/request/playing.ph...
  • Jeff Starr: @Chris: There are so many different things involved with any given layout that it is difficult to troubleshoot and solve problems wit...
  • Martin: Chris: Not sure exactly what the issue is (perhaps someone else can be more specific in their assistance) but the following article w...
  • Jeremy: This worked great with OS 10.5.5 and my Blackberry Pearl (8100). Thanks!...
  • Chris: It is amazing how many dofollow plug ins there are. It is a wonderful thing if people use it correctly. My blogs are on blogspot and ...
  • Chris: Martin: Both of the divs have different IDs, but the problem seems to be with how the 'content' div handles what the new div 'contain...
  • Jeff Starr: Hi David, I disagree entirely that the issue described in the article is anything at all abnormal. I have developed many sit...
  • balisugar: Hi, sorry to botter you, I need help. I think I have a few pages with strange url, that i can see from my wassUp stats. That xxx i...

Read more recent comments..

Subscribe to Content Recent Activity

Recent Articles

Popular Posts

Recent Updates

Random Articles

Explore the Archives..

Attention: Do NOT follow this link!