
DreamHost has been a privately held company since 1997 when they first started hosting their customers' dreams, so that should give you some indication that they're serious about what they do! DreamHost knows what it takes to provide rock-solid service and connectivity, and they consistently deliver both.
They're currently connected to the Internet via redundant gigabit connections with multiple carriers to ensure continued network connectivity in case any carrier goes down. Each connection is carried across a diversified fiber network and connects to different entrances to the Internet's backbone. This allows for total network redundancy. DreamHost also keeps their bandwidth unsaturated. They carry enough network capacity to double their load if they need to.
Web Developers sometimes use file.ext?v=004 as a version control system to force visitors to use updated files. This is terrible. Instead link to apache-003.css and set it to be cached forever. When you change the file you just change the links to apache-004.css. That eliminates millions of bandwidth and resource robbing If-Modified-Since requests. You only need Apache with mod_rewrite, and 1-10 minutes!
Ever wanted to execute commands on your server through php? Now you can. I’m calling this file (see below) shell.php and it allows you to run commands on your web server with the same permissions that your php executable has.
This is not an introduction to .htaccess… This is the evolution of .htaccess… The BEST, the ORIGINAL, the NEWEST, and the most HIGHEST, FLYEST .htaccess tricks I can find.
Originally known as the “Ultimate .htaccess Guide”, its changed over the years by adding new .htaccess tricks and .htaccess examples to it.. I also add my favorite .htaccess links, the best .htaccess articles on AskApache, the coolest .htaccess experiments, the Web’s best .htaccess hacks, and update this article on the regular.
Learn how to setup, configure, secure, optimize, and create a low-maintenance website the AskApache way. I’m piecing together all the hacks, tricks, methods, and ideas discussed throughout this blog and all across Netdom and glueing them all together to show you how to have the most optimized, crazy fastest, and best website setup I can think of.
This is part II of the Advanced SEO used on AskApache.com Series and describes how to control which urls are indexed by Search Engines and how to move them higher up in Search Results.
We’ve figured out what mod_rewrite variables look like, a cheatsheet of the actual value.
Scrolls the latest log entries for multiple log files to the current screen or to any other monitor or TTY in color using syntax highlighting, making debugging easier and saving a lot of time for multi-monitor workstations.
This simple unix shell script automatically creates backups of a specific folder at regular hourly, nightly, weekly, and monthly intervals. Instead of the usual method for copying directory trees using tar with fifo, pipes, rsync, or NFS methods this script uses cpio which is much much faster and has cool options like saving m/a/c times, symlinks, relative paths, and weird file names.
With a rating of 8.58, this marks the highest rated DreamHost Site Of The Month Winner in the History of the Contest!
DreamHost PS gives you your own “virtual machine”, protecting your CPU and RAM on your physical machine for faster websites. Here’s what I like and dislike about DreamHostPS, and some of the issues and solutions for migrating.
RSS | 5:14 PM
This is freaking sweet if you use SSL I promise you! Basically instead of having to check for HTTPS using a RewriteCond %{HTTPS} =on for every redirect that can be either HTTP or HTTPS, I set an environment variable once with the value “http” or “https” if HTTP or HTTPS is being used for that request, and use that env variable in the RewriteRule.
· rewritecond · RSS | 12:34 PM
Mod_Security rivals Mod_Rewrite in the amount of features it provides. I decided to go ahead and post what I learned about it today, even though its tough to give away such awesome htaccess and apache tricks.. Learn how to control spam once and for all, conditionally log/deny/allow/redirect requests based on IP, username, etc.. Mod_Security is so fine!
htaccess rewrite / Mod_Rewrite Tips and Tricks is as glamorous as it sounds! htaccess rewrite mod_rewrite is just possibly one of the most useful Apache modules and features. The ability to rewrite requests internally as well as externally is extremely powerful.
Fresh .htaccess code for you! Check out the Cookie Manipulation and environment variable usage with mod_rewrite! I also included a couple Mod_Security .htaccess examples. Enjoy!
RSS | 12:46 PM
Scan Apache logs for IP address that are probably evil, then generates an .htaccess file to DENY them all.
RSS | 9:46 AM
Using Cache-Control headers you can specify which types of proxies can cache certain content, and how long files should be cached.
RSS | 11:53 PM
Nifty SEO tip to get Search Engine Bots to check your site every hour until you finish working on it and tell them you are finished.
RSS | 12:35 AM
SetEnv, SetEnvIf, and SetEnvIfNoCase directives conditionally set environment variables accessible by scripts and apache based on HTTP Headers, Variables, and Request information.
My improved version of the common printenv / test-cgi scripts for debugging Apache environment variables set in .htaccess files
RSS | 11:40 AM
There are a total of 57 HTTP Status Codes recognized by the Apache Web Server. Wouldn’t you like to see what all those headers and their output, ErrorDocuments look like?
· Apache Status Codes · RSS | 3:56 PM
DreamHost has a contest every month nicknamed “DHSOTM” or DreamHost Site Of The Month, that lets the customers rank websites hosted on DreamHost.
By winning the contest you get to put a graphic designed in the 90’s on your site. I want it so bad!
Today I successfully learned how to compile and run multiple custom php installations for a DreamHost account, and to get it working I came upon a simple shell script that I made a couple changes to.
RSS | 11:11 PM
Ultimate Redirect Cheatsheet for multiple programming languages. Redirecting Users with Javascript redirect, meta refresh redirect, and php redirect, also htaccess methods, python, coldfusion, asp, perl, etc.
.htaccess and php example serves .pdf files to give visitors the choice to open in an external program or save to disk without having to open it in the browser
PDF Before and after Fix – Firefox
RSS | 2:54 AM
Apache .htaccess Directives and Loaded Modules allowed on DreamHost Apache Server 2 Setups.
You may have noticed that we do things a little differently around here. There’s a reason for that.
Often I am programming a plugin, or modifying my .htaccess rules, or editing a WordPress template file and I get stuck when it comes to how WordPress rewrites url’s internally. This simple plugin displays all the internal WordPress rewrites.
RSS | 4:07 PM
To make your site even faster, serve certain content from different subdomains. The reason this works is amazingly cool!
RSS | 7:50 PM
Update: This article is a bit dated, to get the newest and latest Google Analytics Speed Tips, check out the 3 part update about Hosting, Cookie Domains, and JavaScript Loading and Failproofs
Ever notice that sometimes your sites take a while to load all the way because google’s urchin.js file is taking forever? You may recognize this problem when you see something similar to this in your browsers status bar “Transferring data from google-analytics.com...”
Time To Setup?
4 minutes I got tired of seeing that all the time and so I set up an automated cronjob that runs every 12 hours and downloads the latest version from google, and saves it to my website directory, then I reference /urchin.js instead of http://www.google-analytics.com/urchin.js.. and my site loads a lot faster!
Take a look at the source for this page if you want to see what is going on (look at the bottom)
There are 2 pretty major things that you accomplish by hosting urchin.js locally
You Enable persistant connections
You ensure that the correct 304 Not Modified header is sent back to your site visitors instead of reserving the entire file.
The urch.sh shell script
Create a shell script called urch.sh.. this will be executed every 1/day or 1/wk, whatever you want. The following script removes the local urchin.js, then it wgets the latests version into the local directory.
#!/bin/sh
rm /home/user/websites/askapache.com/z/j/urchin.js
cd /home/user/websites/askapache.com/z/j/
wget http://www.google-analytics.com/urchin.js
chmod 644 /home/user/websites/askapache.com/z/j/urchin.js
cd ${OLDPWD}
exit 0;
Improved shell script
I realized right away that a more modular shell script would be needed.. I admin like 50+ web-sites and it would be stupid to have to type the same block of code 50 times, wget the same file 50 times, etc.. So this version downloads the urchin.js file into a temporary directory, then it copies it OVER the old file for each directory. So 1 GET request …
RSS | 11:10 PM
If you remove the Last-Modified and ETag header, you will totally eliminate If-Modified-Since and If-None-Match requests and their 304 Not Modified Responses.
By removing the ETag header, you disable caches and browsers from being able to validate files, so they are forced to rely on your Cache-Control and Expires header.
RSS | 11:54 PM
A first-time visitor to your page will make several HTTP requests to download all your sites files, but using the Expires header you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views.
Before![]()
After trick
I am often logged in to my servers via SSH, and I need to download a file like a WordPress plugin. I’ve noticed many sites now employ a means of blocking robots like wget from accessing their files. Most of the time they use .htaccess to do this. So a permanent workaround has wget mimick a normal browser.
RSS | 11:26 AM
Use the Apache module mod_deflate to compress your static .css and .js files, speeding your site up like crazy!
Apache Web Server users have problems getting Apache Authentication/password-protection in htaccess working, this is a troubleshooting guide to get Password Protection working!
· apache .htaccess · RSS | 5:44 AM
WordPress blogs show the same duplicate content for http://www.askapache.com/index.php and http://www.askapache.com/. If you’ve read about using a robots.txt file for WordPress SEO, than you already understand this setup results in Duplicate Content penalties being levied against your Blog and Web Site by Search Engines.
Webmasters often use SSH to remotely admin web sites and servers, learn how to make your shell colorful and powerful using my sample .bash_profile and you can be up and running in 30 seconds!
Since I was disqualified and accused of cheating, which is absolutely false, I decided to go ahead and do the crime I have been punished for. That’s right, I’m going to show YOU how I could have rigged the DHSOTM contest to hopefully make the statement that I absolutely did not cheat and I absolutely want to be re-instated as the winner.
AskApache.com won the contest for May! Thanks to all of you who voted for my site! Even though AskApache won the contest according to the rules, somehow they said I cheated by giving DreamHost too much free publicity and advertising. I love DreamHost!
RSS | 11:56 AM
Learn how to make YOUR DreamHost promo codes work much better for YOU! This is not about promo-codes, this is about a simple method you should implement.
Please consider donating to support active development of the free software and articles here.![]()
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. Tim Berners-Lee
It's very simple - you read the protocol and write the code. -Bill Joy
HTML | DCMI | GRDDL | XOXO | XDMP | XFN | DOM | XML | XHTML 1.1 Strict | CSS 2.1 | W3C | TLDP | WAI | DISA | ICSI | GIAC | SANS RR | GHOST | DEFCON | NIST | DHS CYBER | NIST
↑ TOPExcept where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. HTTPD based on NCSA HTTPd