Post by AskApache | Aug 12, 2008
thought I'd take a break from coding and post about how open-source is such a great tool for finding the best answers to the toughest questions,
/** is the status code informational */
#define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
/** is the status code OK ?*/
#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
/** is the status code a redirect */
#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
/** is the status code a error (client or server) */
#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
/** is the status code a client error */
#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
/** is the status code a server error */
#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
/** is the status code a (potentially) valid response code? */
#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
Hacking
Aug 10, 2008
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.
Linux
Aug 05, 2008
If you want to pre-load .flv / .mp3 files into a visitors browser cache using flash, here's the actionscript I use to do it, and some ideas behind a good javascript implementation using swfobject or ufo.
Optimization
Aug 04, 2008
Enter your DOMAIN_ROOT and the location of your wp-config.php or config.php, and this script finds all the mysql settings by parsing the phpbb or wordpress config file, then creates GPG encrypted backups, and saves your settings for future automation.
Shell Scripting
Jun 12, 2008
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.
Shell Scripting
Jun 03, 2008
With a rating of 8.58, this marks the highest rated DreamHost Site Of The Month Winner in the History of the Contest!
Hosting
May 31, 2008
Registering on a WP blog requires entering a username and email then checking your email for an auto password.
Too much work to put your users through?
This uses just email and password and does it all.
WordPress
May 31, 2008
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.
Hosting DreamHost
May 28, 2008
Learn how in a year, with no previous blogging experience this blog was able to rank so high in search engines and achieve 15,000 unique visitors every day. Uses combination of tricks and tips from throughout AskApache.com for Search Engine Optimization.
SEO
May 07, 2008
Wouldn't you love to have Akismet Anti-spam protection for non-wordpress forms and pages?
PHP
Apr 29, 2008
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.
Htaccess HTTPS RewriteRule SSL
Apr 23, 2008
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 Htaccess mod_security security
Apr 19, 2008
Search all files in a directory, replacing all occurances of string with a replacement string.
Shell Scripting
Apr 08, 2008
Want to block a bad robot or web scraper using .htaccess files? Here are 2 methods that illustrate blocking 436 various user-agents.
Htaccess
Apr 01, 2008
A WordPress plugin that caches your entire blog for WP-Cache, I love this plugin and finally released it to the public!
WordPress
Mar 29, 2008
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "google.com"
ErrorDocument 403 https://google.com
Some of the Ins and Outs of using SSL Connections with Apache.
Htaccess 301 Redirects Htaccess mod_rewrite SSL
Mar 29, 2008
AskApache Password Protect adds some serious password protection to your WordPress Blog. Not only does it protect your wp-admin directory, but also your wp-includes, wp-content, plugins, etc. plugins as well. Imagine a HUGE brick wall protecting your frail .php scripts from the endless attacks of automated web robots and password-guessing exploit-serving scripts.
WordPress .htpasswd Htaccess Password wordpress
Mar 28, 2008
This article shows how to save and modify php session data, cookies, do anything really... without using ajax or iframes or forcing the user make a request.
PHP
Mar 26, 2008
Google Analytics for your clients sites is a no-brainer, it ROCKS! I have 100+ client sites running Analytics and all of them have trouble-free (no password or username to remember) access to their site reports. Thanks to the method in this post, my clients couldn't be happier..
Google
Mar 26, 2008
Learn about the 7 different HTTP response codes specifically reserved for redirection. 301, 302, 303, 304, 305, and 307.
SEO
Mar 16, 2008
Scan Apache logs for IP address that are probably evil, then generates an .htaccess file to DENY them all.
Security
Mar 15, 2008
Implementing an effective SEO robots.txt file for WordPress will help your blog to rank higher in Search Engines, receive higher paying relevant Ads, and increase your blog traffic. Get a search robots point of view... Sweet!
SEO Google meta robots robots.txt SEO
Mar 11, 2008
If you desire SPEED from your WordPress blog, the #1 speed improvement comes from using the WP-Cache Plugin. If you still desire SPEED after installing the Plugin, you can modify the WP-Cache Plugin code to make your blog even faster!
Optimization Cache wordpress WP-Cache
Mar 10, 2008
Using Cache-Control headers you can specify which types of proxies can cache certain content, and how long files should be cached.
Htaccess Cache-Control Htaccess
Mar 04, 2008
Part II: Example illustrating how to speed up GET/POST form submissions. Uses fsockopen to initiate a server-side background request to process the submitted data, so that the result page of the form is displayed to the client lightningly quick.
PHP
Mar 01, 2008
How To remove the /category/ from WordPress category urls.
James
We're using WP as a CMS with pages and posts. Done a bit of customization, so it looks sweet. Problem - i have some child categories that throw 404 when the category redirect is in place. How did you remove the category base from the url structure in wordpress?
WordPress
Feb 28, 2008
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.
SEO
Feb 12, 2008
Just a very brief look at speeding up form submission by delegating the processing and bandwidth to your server, not your client.
PHP bottleneck cURL form fsockopen PHP snoopy
Feb 09, 2008
A hit-list of some of my favorite mod_rewrite code snippets for .htaccess files
Htaccess
Feb 07, 2008
WordPress plugin gives you control over HTTP Basic Authentication for your WordPress blog which among other things, stops most automated hacking attempts and exploits being attempted, cutting down on the number of requests, connections, and mysql queries for all WordPress blogs on the Internet.
WordPress
Feb 04, 2008
How I was able to preload many flash flv and swf files on one of my clients sites that has a lot of online video and relatively small traffic. Their site visitors would usually watch 3-10 videos per visit and so to make the videos load almost instantly on every page I came up with a way to preload the top 10 .flv files and the swf flv player files as soon as the visitor successfully started watching the 1st video. Of course I also setup .htaccess caching on the server so that once they downloaded the files into their cache they would never request them from the server again. I was having fun with this so its pretty funky and uses some really cool combinations of javascript, swf preloader from xml, css classes to help automate it all..
Optimization Actionscript Cache Caching Flash flv Htaccess preload SWF
Jan 30, 2008
A plugin built to generate static files from php+mysql for Apache to serve the way its supposed to be.. My dream. Conclusion: Needs some improvement, pretty sweet though.
Optimization
Jan 30, 2008
Host Google Analytics ga.js file locally for increased speed! Makes web pages load faster.
Google
Jan 30, 2008
This plugin has been updated for WordPress 2.5 and includes more options to get your site indexed by Google and Yahoo.
WordPress
Jan 29, 2008
Learn how to log and debug usernames and passwords used to login to a htaccess basic authorization protected website using php. This article is BOSS and will show you how to fully take control of this aspect of security using php and .htaccess, I don't believe you will find instructions to do this anywhere else on the net.
Htaccess
Jan 25, 2008
For the good of your followers,
for the good of mankind,
and for our own enjoyment,
we shall proceed to expel you from the Internet and systematically dismantle the Church of Scientology in its present form.
Hacking
Jan 23, 2008
I've put up a new tool to check the strength of your password hash, that locates weak passwords by searching Rainbow Tables for md5 or sha1 hash match. Locate and fix this common security vulnerability before being exploited.
Security
Jan 17, 2008
If your WordPress blog uses AdSense, and you love Firefox you will love this plugin. When a user downloads and installs Firefox through your referral, we'll credit your account with up to $1.00 (more details).
WordPress
Jan 16, 2008
Let me show you an example that works so well I am using it right now on my site. Every page in fact. If you are a young or up and coming web developer with skills to pay the bills, lets make the future Net fast, learn about optimization and refactoring while you still have the chance.
CSS
Jan 11, 2008
If you have a Powweb Webhosting account, you will appreciate this simple skeleton .htaccess file for use on their systems.
Htaccess Htaccess Powweb skeleton