mod_rewrite and htaccess: Its ALL Here
Just like any coder and webmaster, we need to use .htaccess to make our lives easier and websites better. Whether you are rewriting ugly code to make it pretty or making up pages to increase your index (will post about this later), .htaccess is the diamond in the rough that will make you cry when you don’t know how to work it.
I’ve gone through literally hundreds of pages looking for a single, complete guide to .htacess and have yet to find one. So I’ll just share those links and some information that they don’t have here.
Ultimate Guide to htaccess and mod_rewrite
This is one of the more complete guides I’ve seen on .htaccess and mod_rewrite
The only thing that is missing is what each “flag” means so here they are..
[F] - Forbidden - Won’t show the page
[L] - Last Rule - If the conditions are met, then this is the last rule that is processed
[R=code] - Redirect - Used for redirects. code = 301 for permanent redirects and 302 for temporary
[NC] - No Case - upper case/lower case/proper case, doesn’t matter
These codes I got from mod_rewrite, a beginner’s guide (with examples) which is another great guide to .htaccess.
For a huge guide, check out Stupid htaccess Tricks. This is the biggest and, in my opinion, best guide out there. It has all of the flags, table of contents for easy navigation, tons of “stupid”, yet absolutely vital, tricks for your site.
Filed under: Code Snippets | 1 Comment »

