RegEx and the Mod_rewrite reference sheet
Continue reading "RegEx and the Mod_rewrite reference sheet"
For example, if your script uses a parameter like this: http://www.yoursite.com/home.php?id=5
A mod rewrite rule can allow users to use: http://www.yoursite.com/home/5/
Many search engines seem to penalize sites that use URL parameters, and are more likely to index and value the non-parameter version. Of course, that's not all that mod_rewrite can do. Many people use it for its ability to offer at least a layer of Hotlink protection, or to handle things like forwarding visitors from obsolete pages that might exist in a search engine to the new ones.
Using and understanding the black magic of mod_rewrite requires a basic understanding of Regular Expressions or as they are typically known: RegEx. If you're new to RegEx, think of them as wildcards on steroids. The October Lampsig meeting will present RegEx basics, and if you're in Los Angeles, definately try and attend the presentation, which will be given by Peter Benjamin. Check out Dave Child's succint reference for this powerful module whether or not you plan to attend Pete's presentation.