How do I change the default URLs to contribution or event registration pages?
CiviCRM itself provides no mechanism for customizing any URL aliases, or for generating them automatically. This is handled in the CMS or at the webserver level through URL Rewrite on IIS, mod_rewrite on Apache, ModRewrite in Lighttpd, and so on.
By the book, manual aliases or redirects for contribution pages or any other CiviCRM pages are to be handled at the CMS or webserver levels.
Drupal
The recommended route is to use the Redirect module, which allows you to manually set up 3xx redirects.
The core Path module in Drupal does not support query strings, unfortunately (this is a frequently requested feature). Aliases are designed to work with internal Drupal system paths, which CiviCRM paths are not. If you want to use aliases instead of redirects, you'll need to use a workaround, some of which are suggested in the referenced thread:

Use the Query Parameters To URL module to rewrite query parameters into Clean URL components
Try inserting an extra slash in the path, e.g. http://example.com/civicrm/event/register/?id=1&amp;reset=1
Encode the path, then prevent Drupal from decoding it

Instead of using the CiviCRM-generated contributon or registration forms, you could use also Webform CiviCRM Integration to create a webform for it. Since the webform is a Drupal node, it will work with pathauto and should work with all other Drupal modules and APIs related to path aliasing.
On one of my sites, we don't display the contribution page directly, but use Drupal Views to provide a more custom layout. This neatly solves the issue because you aren't using a CiviCRM path at all, and only need to send, for instance, the event ID: https://example.net/myview/3 . Since this is a valid system path, it can not only be aliased but used in menus, and thus become https://example.net/fundraiser easily.
For example, we might set up two views: one listing upcoming events, and one to display details of an individual event. In the first view, we retrieve the event ID but hide it from display, outputting in the path to the second view. Thus, /myview/[event_id] gets populated as /myview/3. In the second view, the event_id is set up as a Contextual Filter (known in D6 as Arguments), and then we can pick and choose what fields or event information to display.
There isn't any mechanism to set up the redirects or aliases automatically. CiviCRM does not implement the Pathauto api, and exposes no Rules Events related to contribution pages or event creation to Rules.
Joomla
In Joomla, the suggested solution is to create a menu link for the contribution page and define the &quot;pretty&quot; URL in the alias field; naturally, Search Engine Friendly URLs must be enabled in GlobalSettings.