"You can reference the basics of mod_rewrite syntax and
rules on the link provided that points back to apache.org. While
this page (or pages it links to within the same site), obviously,
covers all the aspects of using Apache's "mod_rewrite," the style
may not be suited to everyone. It's great information, but assumes
some level of comfort that you may or may not already have
regarding the subject matter.
"In our few examples today (which won't cover much but should be
explained with a good amount of detail), we're going to use a file
named ".htaccess" (the dot at the beginning of the name is
important!) placed in our web server's root folder (or base folder,
etc) which contains the "mod_rewrite" rules. Our first example will
implement the equivalent of a 3xx redirect using "mod_rewrite"
instead of the more conventional methods. In order to implement
this, just place the following content in your .htaccess file
(assuming, again, that we want visitors to www.myxyz.com to be
redirected to www.myotherxyz.com):"