Posts categorized: Blog
How to Shorten any URL with Apache/.htaccess
People prefer short links. The shorter the better. They are easier to remember, easier to type, and just look better than long, complicated URLs. For sites running on Apache servers, you can shorten long URLs with just a few lines of code added to Apache config or your site’s main .htaccess file. Here’s how to […]
Book Update: Version 2.0
Version 2.0 now available! This update to the First Edition of .htaccess made easy features several improvements, including updated techniques, new resources, better formatting, and more. Here is a summary of changes:
Require Login to Access WordPress Media Files
This tutorial shows how to require user login to access any files stored in the WordPress Media Library. So for example, let’s say that you have a bunch of images uploaded via the Media Library. And you want to protect those images, so that they are not accessible to the general public. The user must […]
Book Update: Version 1.9
Version 1.9 now available! This update to the First Edition of .htaccess made easy features many improvements, including updated techniques, new resources, better formatting, and more. Here is a summary of changes:
.htaccess Tip: Rewrite vs. Redirect
Quick .htaccess tip! When using Apache mod_rewrite, you can redirect any request by including the [R] flag, for example: RewriteRule (.*) /somewhere/ [R=301,L] Here we are redirecting via 301 “Permanent” response. So the client will be redirected to /somewhere/. Now here’s the trick: let’s say that, instead of redirecting, we want to rewrite the request, so that we […]