Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.

Follow

Create Custom URLs Using URL Mapping

avatar of OpenCities Product Team

OpenCities Product Team

Last updated

This task is for users with the OC Power Publisher, OC Site Manager, or OC System Administrator roles.

URL Mapping allows you to create shorter, more readable URLs for pages with long or complex URLs. You can use this feature to redirect, customize, or trim an original URL address, which is necessary when promoting webpages in print or social media where you have less space for your message.

For example, you may need to promote an event on your social media accounts, but the full URL takes up too many characters and leaves you little space for other information. You could use URL Mapping to shorten a URL for:

[yoursite]/Community/Events-Activities/December/Winter-Magic-Festival

And create a more straightforward and approachable URL, such as:

[yoursite]/Winter-Magic-Festival

This new URL will redirect users to the original event page, which gives you more space in your communication to give other details and makes it easier for your community to type it into their browser if they need to.

Before we go through how to create them, let's first talk about the difference between URL Mapping, redirects, and creating URL addresses in the Settings tab.

URL Mapping, Redirects, and Creating URL Addresses

On the surface, URL Mapping, redirects, and creating URL addresses all do the same thing: They create a redirect link that visitors can use to enter or navigate your site. But there are some differences in how they're best used.

  • URL Mapping is best used to create shorter, more readable URLs that your community can quickly enter into their browser and which are more palatable on social media. Additionally, they are helpful if your new website has not been indexed by search engines yet; you can create URL Mappings for the top search results so that URLs for your old site link to your new site. This has the added benefit of redirecting users who might have old URLs bookmarked.
  • OC Redirect Pages are great for linking to internal or external pages while appearing in navigation menus, content lists, search results, and child links on landing pages. 
  • The Create URL address field in the Settings tab on any page is available to users with OC Site Manager or OC System Administrator roles. This option is helpful for ensuring that URLs for previous page versions can still link to the current version. For example, you may need to move a page from one section to another, and publishing the page in its new section will alter the URL. When you move and Publish the page, a new URL will be created in the Create URL address list, ensuring that any site visitors with the URL for the previous version will be redirected to the current version without encountering a 404 error page. Additionally, you can use this option for any users who have saved the URL to an archived or deleted page; adding a new URL here before you archive or delete the page will redirect them to a new page.

Create a URL Mapping

To create a URL Mapping:

  1. Go to More > URL Mappings. You'll see a searchable list of previously created mappings.
    the URL mapping admin screen
  2. To create a new one, select Create Mapping.
  3. Fill out the necessary fields.
  4. Select Create Mapping to confirm and save your settings.

the create mapping fields

You can also Edit, Delete, or Deactivate an existing mapping by selecting the option from the cogwheel drop-down menu.

What to Include in Your URL Mapping

Use the following information to create your URL Mapping:

  • Requested url: This field will display the domain of your site already. Enter your preferred URL in the text box provided. For the example above, you would enter Winter Magic Festival. If the URL is already in use, you will be asked to choose another address.
  • Redirect to: Enter the URL you want your Requested url to link to in this field. You can paste the URL directly into the field, use the content selector to navigate to the internal page you need, or start typing the Page name in the field and select the correct page from the list.the redirect to field with a page selected
  • Redirect all URLs that start with the requested URL path: If this is checked, all URLs with additional information added to the mapping will also redirect to the specified address. With the example above, [Public]/Winter-Magic-Festival/Winter/Events will redirect to the Winter Magic Festival event page.
  • Keep the requested URL after redirect: Check this box to ensure the shortened URL remains in the browser after the page loads. Please note that this function is only effective when redirecting to pages within the same domain and will not work for redirects to pages in a subsite. 
  • Activate date: Set an activation date for your URL Mapping. By default, the mapping will activate as soon as it's created. However, you can set an activation date to correspond to when the URL is relevant, such as mapping for an event that happens throughout December.
  • Deactivate date: Set a date for the URL Mapping to deactivate. The mapping will continue indefinitely if you don't set a Deactivate date.

What Else?

Was this article helpful?
3 out of 4 found this helpful