Answers.Body: <p>In Drupal 7, the book is a bit out of date, as URL aliases work now.</p>
  
  <ol>
  <li>Navigate to Configuration > Search and metadata > URL aliases > Add alias (this leaves you at /admin/config/search/path).</li>
  <li>Enter the CiviCRM url (without the domain part) in Existing system path, eg civicrm/contribute/transact?reset=1&amp;id=1</li>
  <li>Enter the desired alias in Path alias, eg donate</li>
  <li>Click Save.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-18T18:41:26.367Z
Answers.Text: The alias doesn't seem to show up, however, if you add it to a menu. It still shows the system URL instead of the alias for some reason.
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-27T15:23:59.263Z
Answers.LastActivityDate: 2015-03-27T15:23:59.263Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>For <strong>WordPress</strong> there are a couple of options:</p>
  
  <ol>
  <li>Embed the form into a standard WordPress page <a href="http://book.civicrm.org/user/current/website-integration/integrating-with-wordpress/" rel="nofollow">with a shortcode</a>. You can then use the WP URL of your choosing, in the standard WP way.</li>
  <li>Install a plugin such as <a href="https://wordpress.org/plugins/redirect-editor/" rel="nofollow">Redirect Editor</a>.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-26T10:38:23.973Z
Answers.Text: Update: don't use Redirect Editor - it was taken over and went weird
Answers.UserDisplayName: Andrew West
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T16:47:26.557Z
Answers.LastActivityDate: 2015-03-25T16:47:26.557Z
Answers.UserDisplayName: Andrew West
Answers.Body: <p>You would do this at the CMS level, or with Apache mod_rewrite. In Drupal, you can go to <code>/admin/config/search/path</code> and create a new alias to <code>civicrm/event/info?reset=1&amp;id=3</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T15:09:53.627Z
Answers.LastActivityDate: 2015-03-25T15:09:53.627Z
Answers.UserDisplayName: Nicholai
Answers.Body: <p>It takes some manual work, but for some important Civi links and events etc., I've just been putting them in my .htaccess file in root of my linux/Apache setup. Here's an example.</p>
  <pre><code>Redirect 301 /contribute https://watershedmg.org/civicrm/contribute/transact?reset=1&amp;id=5
  Redirect 301 /Contribute https://watershedmg.org/civicrm/contribute/transact?reset=1&amp;id=5
  Redirect 301 /happyrain https://watershedmg.org/civicrm/event/info?reset=1&amp;id=533
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-25T19:26:51.267Z
Answers.LastActivityDate: 2020-08-25T19:26:51.267Z
Answers.UserDisplayName: desierto
Answers.Body: <h1>Backdrop</h1>
  <p>Backdrop has many of the same potential solutions as described Drupal 7, but also a few that are unique to Backdrop:</p>
  <ul>
  <li><a href="https://github.com/backdrop-contrib/civicrm_fields" rel="nofollow noreferrer">CiviCRM Fields</a>: Insert CiviCRM Contribution pages or Event Registration pages into fields which are attached to entities as usual (Nodes, Terms, Users)</li>
  <li><a href="https://github.com/backdrop-contrib/civicrm_blocks" rel="nofollow noreferrer">CiviCRM Blocks</a>: Same as above but insert via blocks in a layout instead of an individual field. (Great for inserting on multiple pages at once, for example in an entire section of the website).</li>
  <li><a href="https://lab.civicrm.org/dev/backdrop/-/issues/7" rel="nofollow noreferrer">Layout conditions that consider query parameters</a>: This one is a feature request with a functional PR, but will allow you to specify visibility conditions based on query parameters, which gets to the original question of how to control sidebar or other content on the page based on which CiviCRM page is being viewed.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-30T22:30:48.913Z
Answers.LastActivityDate: 2022-09-30T22:30:48.913Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>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.</p>
  <p><a href="http://book.civicrm.org/user/current/contributions/setup/" rel="noreferrer">By the book</a>, manual aliases or redirects for contribution pages or any other CiviCRM pages are to be handled at the CMS or webserver levels.</p>
  <h3>Drupal</h3>
  <p>The recommended route is to use the <strong><a href="https://www.drupal.org/project/redirect" rel="noreferrer">Redirect</a> module</strong>, which allows you to manually set up 3xx redirects.</p>
  <p>The <strong>core Path module in Drupal does not support query strings</strong>, unfortunately (this is a <a href="https://www.drupal.org/node/118072" rel="noreferrer">frequently requested feature</a>). 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:</p>
  <ul>
  <li>Use the <a href="https://www.drupal.org/project/query_parameters_to_url" rel="noreferrer">Query Parameters To URL</a> module to rewrite query parameters into Clean URL components</li>
  <li>Try inserting an extra slash in the path, e.g. <a href="http://example.com/civicrm/event/register/?id=1&amp;reset=1" rel="noreferrer">http://example.com/civicrm/event/register/?id=1&amp;reset=1</a></li>
  <li>Encode the path, then <a href="https://drupal.stackexchange.com/questions/111307/disable-encoded-url-showing-non-encoded-urls-content">prevent Drupal from decoding it</a></li>
  </ul>
  <p>Instead of using the CiviCRM-generated contributon or registration forms, you could use also <a href="https://www.drupal.org/project/webform_civicrm" rel="noreferrer">Webform CiviCRM Integration</a> 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.</p>
  <p>On one of my sites, we don't display the contribution page directly, but use <strong>Drupal Views</strong> 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: <a href="https://example.net/myview/3" rel="noreferrer">https://example.net/myview/3</a> . Since this is a valid system path, it can not only be aliased but used in menus, and thus become <a href="https://example.net/fundraiser" rel="noreferrer">https://example.net/fundraiser</a> easily.</p>
  <p>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.</p>
  <p>There isn't any mechanism to set up the redirects or aliases automatically. CiviCRM does not implement the <a href="https://www.drupal.org/documentation/modules/pathauto" rel="noreferrer">Pathauto</a> api, and exposes no Rules Events related to contribution pages or event creation to <a href="https://www.drupal.org/project/rules" rel="noreferrer">Rules</a>.</p>
  <h3>Joomla</h3>
  <p>In Joomla, the suggested solution is to create a menu link for the contribution page and define the <strong>&quot;pretty&quot; URL</strong> in the alias field; naturally, Search Engine Friendly URLs must be enabled in GlobalSettings.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-30T20:45:26.547Z
Answers.Text: +1 for Drupal Redirect - we do this for many of our contribution pages to create short links to use in emails. We have also discussed the possibility of a small module that could auto-create such short URLs whenever a new contribution page is created.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T15:51:44.717Z
Answers.Text: Can you explain the Views payment/registration page solution you reference in a little more detail?
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T16:01:17.680Z
Answers.Text: @Laryn For an event registration, 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.
Answers.UserDisplayName: choster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T20:54:26.170Z
Answers.Text: @choster - nice answer - previously, I have used path aliases rather than redirects. Is there a reason you prefer redirects over aliases? Could you add that to you answer?
Answers.UserDisplayName: michaelmcandrew
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-26T22:43:55.133Z
Answers.Text: @michaelmcandrew Drupal aliases are intended to handle internal system links. Since CiviCRM paths are not Drupal system links, and moreover depend on query strings which Drupal may strip off, leading to unpredictable behavior. A redirect is safer.
Answers.UserDisplayName: choster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-27T15:23:55.580Z
Answers.Text: choster: that problem with Drupal not handling the query strings has been solved.
Answers.UserDisplayName: Joe Murray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-25T15:34:38.373Z
Answers.LastActivityDate: 2015-03-26T22:45:19.277Z
Answers.LastEditDate: 2020-06-17T09:00:50.810Z
Answers.UserDisplayName: choster
Body: <p>Is there a way to customize the default URLs on public-facing contribution pages or event info/registration pages to make them match the site URL schema better? </p>
  
  <p>For example, a default event page URL could be something like this:</p>
  
  <ul>
  <li><a href="https://example.org/civicrm/event/info?reset=1&amp;id=3">https://example.org/civicrm/event/info?reset=1&amp;id=3</a></li>
  </ul>
  
  <p>But it would be wonderful to be able to set that page to be something like this:</p>
  
  <ul>
  <li><a href="https://example.org/event/fundraiser">https://example.org/event/fundraiser</a></li>
  </ul>
  
  <p>In some CMS setups, this would also allow better control over sidebar content that should show up only on certain contribution pages or event pages.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-01T19:31:46.427Z
Comments.Text: Some notes on exploring this in [CRM-17570](https://issues.civicrm.org/jira/browse/CRM-17570) - including a funky misuse of Drupal's title callback to work around CiviCRM requiring `$_GET['q']` to start with `civicrm` :)
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-16T18:20:07.390Z
Comments.Text: Nice feature request.  Note another workaround is to use drupal rules and the redirect module to automate this.  I have this on my "to do" list :)
Comments.UserDisplayName: Sonicthoughts
Tags: <civicontribute><civievent><urls>
Title: How do I change the default URLs to contribution or event registration pages?
ThreadText: # How do I change the default URLs to contribution or event registration pages?
  
  (Asked by: username_0 on 2015-03-25)
  
  Is there a way to customize the default URLs on public-facing contribution pages or event info/registration pages to make them match the site URL schema better?
  
  For example, a default event page URL could be something like this:
  
  * <https://example.org/civicrm/event/info?reset=1&id=3>
  
  But it would be wonderful to be able to set that page to be something like this:
  
  * <https://example.org/event/fundraiser>
  
  In some CMS setups, this would also allow better control over sidebar content that should show up only on certain contribution pages or event pages.
  
  **Tags:** civicontribute, civievent, urls
  
  > **Comments:**
  > **username_2**: Nice feature request.  Note another workaround is to use drupal rules and the redirect module to automate this.  I have this on my "to do" list :)  
  > **username_1**: Some notes on exploring this in [CRM-17570](https://issues.civicrm.org/jira/browse/CRM-17570) - including a funky misuse of Drupal's title callback to work around CiviCRM requiring `$_GET['q']` to start with `civicrm` :)  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_7 on 2015-03-25. Score: 14 | Accepted answer
  
  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](http://book.civicrm.org/user/current/contributions/setup/), 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](https://www.drupal.org/project/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](https://www.drupal.org/node/118072)). 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](https://www.drupal.org/project/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&reset=1>
  * Encode the path, then [prevent Drupal from decoding it](https://drupal.stackexchange.com/questions/111307/disable-encoded-url-showing-non-encoded-urls-content)
  
  Instead of using the CiviCRM-generated contributon or registration forms, you could use also [Webform CiviCRM Integration](https://www.drupal.org/project/webform_civicrm) 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](https://www.drupal.org/documentation/modules/pathauto) api, and exposes no Rules Events related to contribution pages or event creation to [Rules](https://www.drupal.org/project/rules).
  
  ### Joomla
  
  In Joomla, the suggested solution is to create a menu link for the contribution page and define the **"pretty" URL** in the alias field; naturally, Search Engine Friendly URLs must be enabled in GlobalSettings.
  
  > **Comments:**
  > **username_0**: Can you explain the Views payment/registration page solution you reference in a little more detail?  
  > **username_7**: @username_0 For an event registration, 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.  
  > **username_9**: @username_7 - nice answer - previously, I have used path aliases rather than redirects. Is there a reason you prefer redirects over aliases? Could you add that to you answer?  
  > **username_7**: @username_9 Drupal aliases are intended to handle internal system links. Since CiviCRM paths are not Drupal system links, and moreover depend on query strings which Drupal may strip off, leading to unpredictable behavior. A redirect is safer.  
  > **username_3**: username_7: that problem with Drupal not handling the query strings has been solved.  
  > **username_8**: +1 for Drupal Redirect - we do this for many of our contribution pages to create short links to use in emails. We have also discussed the possibility of a small module that could auto-create such short URLs whenever a new contribution page is created.  
  
  ---
  
  ### Answer by username_3 on 2015-03-27. Score: 5
  
  In Drupal 7, the book is a bit out of date, as URL aliases work now.
  
  1. Navigate to Configuration > Search and metadata > URL aliases > Add alias (this leaves you at /admin/config/search/path).
  2. Enter the CiviCRM url (without the domain part) in Existing system path, eg civicrm/contribute/transact?reset=1&id=1
  3. Enter the desired alias in Path alias, eg donate
  4. Click Save.
  
  > **Comments:**
  > **username_0**: The alias doesn't seem to show up, however, if you add it to a menu. It still shows the system URL instead of the alias for some reason.  
  
  ---
  
  ### Answer by username_4 on 2015-03-25. Score: 4
  
  For **WordPress** there are a couple of options:
  
  1. Embed the form into a standard WordPress page [with a shortcode](http://book.civicrm.org/user/current/website-integration/integrating-with-wordpress/). You can then use the WP URL of your choosing, in the standard WP way.
  2. Install a plugin such as [Redirect Editor](https://wordpress.org/plugins/redirect-editor/).
  
  > **Comments:**
  > **username_4**: Update: don't use Redirect Editor - it was taken over and went weird  
  
  ---
  
  ### Answer by username_5 on 2015-03-25. Score: 1
  
  You would do this at the CMS level, or with Apache mod\_rewrite. In Drupal, you can go to `/admin/config/search/path` and create a new alias to `civicrm/event/info?reset=1&id=3`
  
  
  ---
  
  ### Answer by username_6 on 2020-08-25. Score: 1
  
  It takes some manual work, but for some important Civi links and events etc., I've just been putting them in my .htaccess file in root of my linux/Apache setup. Here's an example.
  Redirect 301 /contribute https://watershedmg.org/civicrm/contribute/transact?reset=1&id=5
  Redirect 301 /Contribute https://watershedmg.org/civicrm/contribute/transact?reset=1&id=5
  Redirect 301 /happyrain https://watershedmg.org/civicrm/event/info?reset=1&id=533
  
  
  ---
  
  ### Answer by username_0 on 2022-09-30. Score: 0
  
  # Backdrop
  
  Backdrop has many of the same potential solutions as described Drupal 7, but also a few that are unique to Backdrop:
  
  * [CiviCRM Fields](https://github.com/backdrop-contrib/civicrm_fields): Insert CiviCRM Contribution pages or Event Registration pages into fields which are attached to entities as usual (Nodes, Terms, Users)
  * [CiviCRM Blocks](https://github.com/backdrop-contrib/civicrm_blocks): Same as above but insert via blocks in a layout instead of an individual field. (Great for inserting on multiple pages at once, for example in an entire section of the website).
  * [Layout conditions that consider query parameters](https://lab.civicrm.org/dev/backdrop/-/issues/7): This one is a feature request with a functional PR, but will allow you to specify visibility conditions based on query parameters, which gets to the original question of how to control sidebar or other content on the page based on which CiviCRM page is being viewed.
  
  
  ---
  
  