Overall structure of an address and its elements is well represented in the first comment to the app/code/core/Mage/Core/Model/Url.php model. You can refresh your knowledge there.
Apache mod_rewrite module plays an important role in URL rewriting. Rules, specified in .htaccess, will not be processed without it. In order to activate URL rewriting, .htaccess.sample file should be renamed .htaccess. The following part is responsible for rewriting: (more…)