What is a rewrite rule?
A rewrite rule is a way that Apache can rewrite an incoming request “on the fly”. In essence, a user can ask a webserver for one file, and the webserver can serve up a completely different file to the user instead. Isn’t this like a redirect? No, a redirect is when the webserver tells a user, “that’s not the file you want, you need to go over here”, at which point the browser loads the new URL. Redirects aren’t always desirable, especially of the files/PHP scripts/whatever are currently living a temporary location. Why would I want to use one? Let’s say you’re installing an app that somebody else wrote, and the app lives under /very-long-application-name. You could use a rewrite rule so that users could go to /short-app-name, and Apache would rewrite that request behind the user’s back to be /very-long-application-name. And the best part is that this is transparent to a properly built application. Another example is maybe you’re starting up a video “tube” site, and you want to have the