.htaccess is a very ancient configuration file for web servers, and is one of the most powerful configuration files most webmasters will ever come across. This htaccess guide shows off the very best of the best htaccess tricks and code snippets from hackers and server administrators.
You've come to the right place if you are looking to acquire mad skills for using .htaccess files!
Apache, Hosting, Htaccess, Optimization, Security, SEO, Web Development, WordPress .htpasswd 301 Redirect Apache Apache HTTP Server Cache Hosting Htaccess Htaccess Software HTTP Headers httpd.conf HyperText Transfer Protocol mod_rewrite Redirect RewriteCond RewriteRule SSL
2 awesome ways to implement caching on your website using Apache .htaccess or httpd.conf. Both methods are extremely simple to set up and will dramatically speed up your site! Htaccess Cache Cache-Control ETag Expires Header Headers Htaccess mod_expires mod_headers
Comprehensive .htaccess example file with advanced examples in 1 htaccess sample skeleton .htaccess file with the very best apache htaccess examples... Updated frequently based on detailed info from the Apache htaccess tutorial.
Htaccess Allow AuthUserFile Deny Htaccess Redirect RewriteCond RewriteEngine RewriteRule
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?
Htaccess 403 404 500 503 Htaccess mod_rewrite PHP RewriteCond RewriteRule
How to password-protect, Allow or Deny a visitor based on a condition. If you are having trouble getting htaccess-based password protection to work see: Troubleshooting htaccess Authentication: Getting it to work
Htaccess AuthName AuthType FilesMatch Htaccess Password Password Protection Require
Links to htaccess tutorials and howtos in the htaccess forum
Htaccess
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
If you have a Powweb Webhosting account, you will appreciate this simple skeleton .htaccess file for use on their systems.
Htaccess Htaccess Powweb skeleton
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
Very nice tutorial dealing with the robots.txt file. Shows examples for google and other search engines. Wordpress robots.txt and phpBB robots.txt sample files. SEO
One of the biggest speed bottlenecks of sites today are images, specifically unoptimized images or large scaled images. With Apaches Rewrite module we can convert all existing jpegs and png files (and most gifs) to webp, then transparently rewrite them so that a request for img.png from a browser that supports webp will receive img.webp.
Hosting, Htaccess, Optimization accept Header png RewriteCond RewriteRule vary webp
Problem: WordPress shows pages, categories, author pages, etc. without an ending '/'.
/about instead of /about/.
/category/htaccess instead of /category/htaccess/.
Solution: Either hook into the user_trailingslashit filter, or use some htaccess RedirectMatch
WordPress permalink PHP RedirectMatch wordpress
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.
Linux bash wget
Use these standards best-practices to achieve more powerful links in terms of SEO, EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM SEO
Turns every 404 Not Found error into a SEO traffic generating event! Help your site visitors find what they were looking for automatically by leveraging both Google and WordPress. It's one of about 6 plugins I use on every WP site I run. Highly recommend you try it for a few months.
«Take My 404 for a Test-Drive
SEO 404 Google 404 SEO wordpress WordPress Plugin
Search Engine Optimization for WordPress WordPress