What is a URL?


URL stands for "Uniform Resource Locator", which is a fancy way of saying "the address of something on the Internet, typically a web page".  In the context of web pages, "address" means something like http://www.website.com/page.htm?age=20&type=ball.  Every page on the World Wide Web has a unique URL (address), including every page in your HarmonySite.


What is a Custom URL?


Pages can actually have more than one URL (address).  If the default URL of a page is overly long, complex or difficult to remember, you can often invent a second URL and assign it to the page, which can be anything you want.  You can create something shorter, simpler and easier to remember, such as http://www.website.com/useful-page.


In HarmonySite, web pages have URLs that look like this http://www.mygroup.com/dbpage.php?pg=contact (which is not particularly short or descriptive of what's actually on the page), or http://www.mygroup.com/dbpage.php?pg=view&dbase=events&id=14524 (which is even worse).  In case you're wondering, the first URL is for a "Contact" page, while the second is for an event.


Because of this, we have made it possible to create your own Custom URLs for pages on your HarmonySite.  Each URL you create becomes a second URL for the page, so that the page can then be reached via either of two URLs.  Using the examples above, you could create new, custom URLs as follows:  http://www.mygroup.com/contact for the "Contact" page, and http://www.mygroup.com/Christmas-Concert for the event.  Each is shorter, simpler, and more descriptive of the contents of the page, and much easier to quote in correspondence or on a Facebook page.


Note that it only really makes sense to create custom URLs for pages that can be accessed via the public (people who are not logged in).  You can create custom URLs for pages visible to members only, but there's no real need to.


HarmonySites provides an easy way to create custom URLs for the following...

  • Website Pages - specifically the set of pages listed on the Pages Administration page, the pages that you can add and remove yourself via the admin interface.  "Website pages", in this context, does not mean any page at all in your HarmonySite.  It's a subtle distinction.  For example, "Website pages" does not include...
    • The page that shows all of a song's details
    • A member's profile page
    • The page where you add the details of a new mailing list
    • etc
  • Events.  Each event can have its own custom URL, if required.
  • Productions (if the "Productions" module is enabled on your HarmonySite).  Productions are really just collections of events, and as such can have custom URLs in the same way that events can  

Having said that, it's technically possible to create custom URLs for any page in your HarmonySite, even ones explicitly excluded in the list above.  It's just not as easy.

  



Creating a Custom URL


A custom URL can be created for any of the "Website pages" in HarmonySite.  This can be done either from within the page itself, or from the Custom URLs page.


Creating a Custom URL from within a page

This is done by "editing" the page.  To check if a page can be edited, log in as a webmaster and scroll to the bottom of the page; if there is an edit button in the bottom-right corner of the page, then this page can be edited, and you can create a custom URL for the page, as follows...

  1. Click on the edit button in the bottom-right corner of the page.
  2. On the Page Details page, on the General tab, scroll down to the Page Meta-data section. There you will see the Custom URL field shown below..

  3. Enter the Custom URL for the page. In the example shown above, we are creating a Custom URL for the Latest News page. We could enter something like news in the Custom URL field, or even latest news. Note: Spaces are not allowed in any URL, so if you enter latest news in the Custom URL field, the spaces will be replaced by hyphens, so your custom URL will become https://www.yourgroup.com/latest-news.
  4. Click Save at the bottom of the page.


Creating a Custom URL from the Custom URLs page

The Custom URLs page allows us to create custom URLs for any of your "Website pages". To access this page, proceed as follows:

  1. Log in as a webmaster
  2. Click on the Admin link in the top-right corner of the page to access the Admin Dashboard.
  3. Scroll down to the Website Content section, and click on the Custom URLs link to the right of this in the Admin Pages column. This displays the Custom URLs page, the top section of which is shown here..


The Custom URL page is divided into 4 main sections: 

  1. Website Pages, shown above, which allows us to create custom URLs for the pages in the "Website pages" database.
  2. Custom URLs from other tables, which allows us to create custom URLs for Events and Productions pages.
  3. Ensure .htaccess is up to date (detailed below).
  4. Add a new Custom URL to .htaccess, which allows us to create a custom URL for any other page, for example a song's page or a poll's page.


Each section of the Custom URL page is described in more detail here:


Website Pages


The Website Pages section of the page, shown below, lists all the pages from the pages database...




For each page, the Page name is shown, along with its Regular URL and its Custom URL, if one currently exists. There is the opportunity to create or update a Custom URL by clicking on the "Update page" icon in the far-right column, circled above.


Pages visible to the public are shown in bold. It is generally only meaningful to create custom URLs for public-facing pages.


To create a custom URL for a public-facing page, proceed as follows:

  1. Click on the "Update page" icon to the far-right of the page you wish to create a custom URL for.  From this point on, it's identical to the instructions above, when editing the page directly.
  2. On the Page Details page, on the General tab, scroll down to the Page Meta-data section. There you will see the Custom URL field shown below..


  3. Enter the Custom URL for the page.
  4. Click Save at the bottom of the page.


Custom URLs from other tables


The Custom URLs from other tables section of the page is shown below. This allows for creation of custom URLs for either Events or Productions.


Note that only events/productions that already have custom URLs are listed, not the entire database of events/productions.



Simply locate the Event or Production for which you would like to create a custom URL, and click on the "Update Event" or Update Production" icon to the right of this (circled above).

To create a custom URL for any event...

  1. Click the [administer] link to the right of either Events or Productions, to take you to the corresponding administration page
  2. Locate the event/production that you wish to create a custom URL for, and click the "update" icon to the right of it
  3. Click the Public tab
  4. Scroll down to the Custom URL heading. Enter the name of your custom URL in the box next to this:
  5. Click Save at the bottom of the page.



Ensure .htaccess is up to date


Most websites (and all HarmonySites) have a file on the server called .htaccess - a configuration file which contains, amongst other things, the complete list of custom URLs configured into your site.  This file is modified directly and automatically whenever you assign a custom URL to a page, event or production.  The file looks something like this...



When you create a custom URL, a new entry beginning with RewriteRule is added to the .htaccess file. Or at least, it's supposed to.  Occasionally the file may not get updated correctly (rare).   If, for any reason, this hasn't happened correctly, you'll notice this because one or more of your custom URLs won't be working.


It's possible to "fix" the .htaccess file so that it correctly lists all the custom URLs, and so that all the custom URLs actually work.  To do so, simply click on the Update file with all custom URLs button at the foot of this section.



Add a new Custom URL to .htaccess

 


As mentioned above, it is possible to assign a custom URL to any page in your system, not just "Website pages", events and productions.  For example, you could create a custom URL for a song's page or a poll's page.



For example, if you have a song that has a url of http://www.mygroup.com/dbpage.php?pg=view&dbase=rep&id=83, and you wanted it to have a url of http://www.mygroup.com/auld-lang-syne, you would do the following...


  1. In the Existing regular URL field, enter just the portion of the existing URL after the last "/" (i.e. dbpage.php?pg=view&dbase=rep&id=83)
  2. In the New custom URL field, enter your own new custom URL for the page, in this case auld-lang-syne.
  3. Click on the Add button.  This will create the new custom URL, by adding a new RewriteRule entry to the site's .htaccess file.