---
title: "URL mapping in Knowledge base Widget | Document360"
slug: "url-mapping"
description: "With the Knowledge base assistant, you can display specific articles depending on the page the end-user is on with Document360's URL mapping feature. "
tags: ["contextual help", "Knowledge base widget", "Premium"]
updated: 2026-04-06T07:25:19Z
published: 2026-04-06T07:25:19Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.document360.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URL Mapping

The **URL Mapping** feature within the knowledge base widget allows you to tailor the display of specific articles and categories based on the pages your end users visit. This functionality not only enhances user experience by directing users to relevant content but also enables you to hide the knowledge base widget on certain URLs or provide a search bar with custom placeholders, guiding users on what to search.

---

## Using URL mapping

To configure URL mapping, you perform specific actions within the knowledge base widget for designated URLs.

### Actions

There are five actions you can execute with URL mapping:

1. **Show article:** Displays a single article on the specified URL.
2. **Show list of articles:** Lists selected articles under the **Recommended**section within the Knowledge Base widget on the specified URL.
3. **Contextual AI assistance:** Allows you to create and use AI-powered prompts within your widget.
4. **Show search results:** Allows you to set a specific search term to query your knowledge base, returning relevant search results on the specified URL.
5. **Hide widget:** Prevents the Knowledge Base widget icon from appearing on the specified URL.

> [!NOTE]
> NOTE
> 
> The Show list of articles action displays content in the Most searched articles section of the widget. If the Hide most searched articles toggle is enabled in the widget settings, this section will be hidden, and the mapped article list will not appear. Ensure this setting is turned off for URL mapping to work as expected.

You can find these actions under the **URL Mapping** tab or when editing an existing mapping.

> [!NOTE]
> ** NOTE
> 
> For URL Mapping to work, the Knowledge base widget must be installed within your site or app. For more information, read the article on [Installing the Knowledge base widget](/help/docs/installing-the-knowledge-base-widget).

### URL Parameters

When configuring the Knowledge Base widget URL, you can include three types of parameters:

1. **Include Path**: `/thisis/a/path`
2. **Include Query**: `?animal=bear`
3. **Include Hash**: `#inbox`

You can also enable the **Is Regex** toggle to incorporate regular expressions into your URL configurations.

[Embedded content](https://www.floik.com/embed/6c8153d2-2726-4c62-b723-2bd209ff8c39/097b3fad-03bf-4790-a87e-3c223817f6c7-flo.html)

---

## Adding URL mapping to your Widget

To integrate the desired widget into your knowledge base site, follow these steps:

1. Navigate to **Connections** **(**)**> **Knowledge base widget**in the left navigation bar of your Knowledge base portal.
2. Go to desired widget and click the **URL Mapping** tab.
3. You can either choose**Ask Eddy AI** to ask any queries or to search an article or choose **New URL mapping.**
4. Click **New URL mapping** and specify the following:

** NOTE

Folder categories are not available for selection. Only **page** and **index** category types are available for selection.
  - **Name** - The URL Mapping name will only be shown on the URL mapping record within Document360
  - **URL structure** - Select the desired URL parameter type (**Include path**/**Include query**/**Include hash**). You must enable at least one URL parameter
  - Type in the URL on which you want the article/category to show or the action to occur.

> [!NOTE]
> ** NOTE
> 
> Your domain name is *not* included in the URL path. For instance, `https://document360.com/ebook/rapid-guide-to-launch-your-knowledge-base/`, your URL Path would be `/ebook/rapid-guide-to-launch-your-knowledge-base/`
  - **Action** - Select the desired action.
  - **Select workspace** - Select the desired version (if you have multiple versions).
  - **Language to** - Select the desired language (if you have multiple languages).
  - **Article to show** - In the search bar, select the articles/categories you want to show from your knowledge base documentation.
5. Click **Create**.

![](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/gif%201(1).gif)

Once an end user accesses your specified URL path and opens the Knowledge Base widget, they will see the mapped article/category. This information remains consistent as they navigate between the Knowledge Base widget tabs within the same version and language.

### Configuring Contextual AI assistance

The **Contextual AI assistance** option lets you display AI-powered prompts in the Knowledge base widget. Based on your configuration, these prompts can appear either when users click a button or automatically when they open a specific page along with the answer to the prompts.

![Widget configuration interface showing URL mapping and contextual AI assistance options.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/contextual%20ai%20assistance.png)

> [!NOTE]
> ** NOTE
> 
> To configure Contextual AI assistance, ensure that AI assistive search is enabled for the widget.

#### Understanding prompting types

You can configure Contextual AI assistance in two ways.

1. **Button-based prompting**
2. **Page-level prompting**

[Embedded content](https://www.floik.com/embed/6c8153d2-2726-4c62-b723-2bd209ff8c39/6c7bdc9a-47a2-412f-ac63-a64784511191-flo.html)

**Button-based prompting**

Use this option to display context-aware help when readers click specific buttons on your website or app.

- Each prompt you add generates a unique Trigger key.
- The prompt is automatically validated on hitting Enter to confirm whether an answer is found in your connected sources.
- You can either update an existing button by adding the custom attribute `d360AIHelp` with the Trigger key as its value, or create a new button by copying the Installation code snippet and pasting it into your HTML.
- When the button is clicked, the widget opens automatically and displays the configured AI prompt with its corresponding answer.
- You can configure up to 5 button–prompt mappings per URL.
- If multiple buttons are configured on the same page:
  - The prompt for the clicked button is displayed first.
  - Prompts from other buttons appear in the widget as related or suggested queries.

**Page-level prompting**

Use this option to provide AI-driven help automatically when users open a specific page, without requiring any button interaction.

- To choose this option, select **Enable page-level prompting**during Contextual AI assistance configuration.
- Add one or more prompts that will trigger when users access the configured URL. The prompt is automatically validated on hitting Enter to confirm whether an answer is found in your connected sources.
- You can add up to 5 prompts per page.
  - The first prompt is shown as the primary question.
  - Remaining prompts appear as suggested queries.

#### Adding, validating, and removing prompts

**For button-based prompting**

1. In the **Configure contextual AI assistance** section, leave the **Enable page level prompting** unchecked.

![Configuration options for a contextual AI assistance widget with various actions listed.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/button0based.png)

1. Next, enter your **Search prompt**.
2. Press Enter to validate the prompt.
  - If the system finds an answer, it displays **Answer found** beside the prompt as a green label.
  - If no matching result is found, the system displays **Answer not found** as a red label.
3. If you are updating an existing button, copy the **Trigger key** and add it to the existing button’s code using the `d360AIHelp` attribute.

For example,

```xml
<button d360AIHelp="no6gNpyDqtyBhCVFMhYDXhugZ">Need help?</button>
```

![Instructions for adding URL mapping and contextual AI assistance in a widget interface.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/trigger%20key.png)

1. If you are creating a new button, click **Copy code** next to Installation code to create the new button, then paste the snippet into your page’s HTML.

![Instructions for configuring contextual AI assistance with a widget installation code.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/copy%20code.png)

1. To add another button-based prompt, click **Add more** and repeat the process.
2. To remove a prompt, click **Remove** next to the respective entry.

**For page-level prompting**

![Configuration options for a widget including URL mapping and contextual AI assistance settings.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/page%20level.png)

1. Select the **Enable page-level prompting** checkbox.
2. In the Search prompt field, enter your query.
3. Press Enter to validate the prompt.
  - If the system finds an answer, it displays **Answer found** beside the prompt as a green label.
  - If no matching result is found, the system displays **Answer not found** as a red label.
4. To add another prompt, click **Add more** and enter a new query. Repeat until you’ve added up to four prompts for that URL.
5. To delete a prompt, click **Remove** beside the prompt field.

Once you have configured either button-based or page-level prompts, click **Create**.

You can mix standard URL mapping actions (such as **Show article**) with **Contextual AI assistance** across different URLs to deliver a tailored, intelligent user experience.

---

## Editing URL mapping

To modify an existing URL mapping:

1. Hover on the desired Knowledge base widget and click the **Edit**(**) icon.

In the **URL mapping** tab, you can find the list of available URL mapping.
2. Hover over the desired URL mapping and click the **Edit**(**) icon.

The **Update URL mapping** panel will appear.
3. Update the desired information and click **Update**.

![](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/gif%202.gif)

---

## Deleting URL mapping

You can delete a set URL mapping.

![](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/delete(1).png)

1. Hover on the desired Knowledge base widget and click the **Edit**(**) icon.
2. In the **URL mapping** tab, you can find the list of available URL mapping.
3. Hover over the desired URL mapping and click the **Delete**(**) icon.
4. Click **Yes** in the **Delete confirmation** prompt.

---

## URL mapping settings

You can define the Knowledge base widget behavior for URLs that do not have a configured mapping. Defining this behavior can improve the user experience and accessibility to the documentation.

![Settings for configuring a knowledge base widget, highlighting URL mapping options.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/url%20mapping%20settings.png)

1. Go to your desired widget and click **Edit**.
2. Click the **Configure & connect**tab.
3. Under the **Set controls** section, expand the **URL mapping settings** section.
4. Select the desired option:
  - **Navigate to the page help/knowledge base**: Select this option to display the article/category in the Page help or Knowledge base tab in the Widget.
  - **Do not make any changes to the existing setup**: Select this option to display the last opened article/category in the Widget.
5. Click **Save**.

---

## Basic URL matching

Understanding URL matching is crucial for effective URL mapping. A general-purpose regex for matching typical URLs looks like this:

```Regex
^https?://?[a-zA-Z0-9.-]+/[a-zA-Z0-9/._-]*??[a-zA-Z0-9=&._-]*?#[a-zA-Z0-9_-]*?$
```

**Explanation of the components**

- `^https?://?`: Matches the protocol (e.g., `http://` or `https://`). The `?` makes the protocol optional.

> [!NOTE]
> ** NOTE
> 
> Ensure to add a backward slash (\) before every forward slash (/) while testing your URL on https://regex101.com.
- `[a-zA-Z0-9.-]+`: Matches the domain name, including letters, numbers, dots (`.`), and hyphens (`-`).
- `/[a-zA-Z0-9/._-]*?`: Matches the path after the domain, allowing slashes, alphanumeric characters, dots, underscores, and hyphens.
- `?[a-zA-Z0-9=&amp;._-]*?`: Matches optional query parameters (e.g., `?key=value`), making this part optional.
- `#[a-zA-Z0-9_-]*?`: Matches the fragment (e.g., `#section`), which is also optional.

---

### Examples of URL mapping using Regex

#### Mapping specific URL structures

The following table shows how to configure URL mappings for certain URL patterns. These configurations help ensure accurate matching based on the URL path or query structure.

| URL Structure | URL mapping configuration |
| --- | --- |
| `/buckets` | `/buckets$` (Configure if the URL ends with `buckets`) |
| `/buckets?isCreatingBucket` | `/buckets\?[a-z]*` (Configure if the URL has random texts after the query parameter) |

****Example matches****

- `/buckets`
- `/buckets?isCreatingBucket`
- `/buckets?isCreatingBucket=true`

To map a URL pattern like `/users/{id}`, use:

```undefined
^/users/[0-9]+$
```

This captures a user ID dynamically.

****Example Matches****

- `/users/123`
- `/users/456`

#### Mapping URLs with query parameters

For URLs like `/search?q={query}`, the regex would be:

```Regex
^/search?q=[a-zA-Z0-9]+$
```

****Example Matches****

- `/search?q=apple`
- `/search?q=123abc`

#### Mapping URLs with optional parameters

For a URL pattern like `/products/{category}/{id}`, where category is optional:

```Regex
^/products/[a-zA-Z]+?/[0-9]+$
```

****Example Matches****

- `/products/123`
- `/products/electronics/123`

#### Mapping URLs with a wildcard or multiple paths

For `/blog/*`:

```Regex
^/blog/.*?$
```

****Example Matches****

- `/blog`
- `/blog/how-to-code`
- `/blog/2021/10`

Mapping URLs with subdomains For subdomain URLs:

```Regex
^https?://?[a-zA-Z0-9-]+.example.com$
```

****Example Matches****

- `http://blog.example.com`
- `https://shop.example.com`

#### Combining multiple components

To handle more complex URL mappings, you can combine the various components as needed. The comprehensive regex that matches a URL with an optional protocol, domain, path, query parameters, and fragment looks like this:

```Regex
^https?://?[a-zA-Z0-9.-]+/[a-zA-Z0-9/._-]*??[a-zA-Z0-9=&._-]*?#[a-zA-Z0-9_-]*?$
```

---

### FAQ

#### How can I remove the Page help and Search bar from the widget when URL mapping for a single article is configured?

To remove the Page help and Search bar from the widget when URL mapping for a single article is configured:

1. Navigate to **Widget**(**) in the Knowledge base portal.
2. Hover over the desired widget and click the **Edit**(**) icon.
3. Paste the provided code in the **Custom CSS** tab:

```css
li#page-help-tab {
    display: none;
}

.article-header .article-back-icon {
    display: none;
}

.search-container {
    display: none !Important;
}
```
4. Paste the provided code in the **Custom JavaScript** tab:

```javascript
setTimeout(function() { $('.search-container').hide();}, 2000);
setTimeout(function() { $("#knowledge-base-tab").click();}, 2000);
```
5. Click **Save**.

This will hide the **Page help** tab and **Search bar**in the widget on the Knowledge base site when URL mapping for a single article is configured.

#### How can I see the updates immediately in the KB Widget after adding or updating a URL Map?

The updates are cached on the server for performance reasons and will automatically refresh every 15 minutes. However, if you need to see the changes immediately, you can clear the application cache.

#### Why does a configured URL mapping appear broken?

The URL mapping would be broken due to any changes in the 'Filter widget content' configuration in the 'Installation & setup' tab. Check the URL mapping and update the configuration.

#### What is URL mapping?

With URL mapping, you can make specific articles and categories appear in the knowledge base widget, depending on the page the end-user is on. You can also use URL mapping to hide the Knowledge base widget on a specific URL or provide a search bar with a custom placeholder to point end-users in the right direction on what to search.

#### Can I add regular expressions (regex) in URL mapping?

You can include regular expressions in your URL by enabling the **Is Regex**toggle.

#### What is regex?

Regex, short for "regular expression," is a sequence of characters that defines a search pattern used to match and manipulate text strings.

For example, you can use regex to configure a single URL mapping for multiple articles with similar URLs. Consider a scenario where you wish to configure URL mapping for the following articles with the base URL `'https://example.com/docs/drive':`

- `https://example.com/drive-General`
- `https://example.com/drive-settings`
- `https://example.com/drive-functionA`
- `https://example.com/drive-functionB`
- `https://example.com/drive-functionC`
- `https://example.com/drive-functionD`
- `https://example.com/drive-functionE`

Without regex, you would need to add individual URL mappings for each URL. However, by enabling regex, you can add with a single URL mapping: Select the "Include path" option and add `docs/drive` in the URL field. You can use regex to have a more efficient and streamlined mapping process.

#### Can I add URL mapping for categories?

Yes, you can add URL mapping for categories. It applies only to page and index categories.

The platform where project members manage and create content for the knowledge base. It allows users to create categories, articles, and templates; manage files, team accounts, and readers; and configure site settings such as branding, domain, and security.

## Related

- [Installing the Knowledge base widget](/installing-the-knowledge-base-widget.md)
- [Enable Eddy AI Assistant](/knowledge-base-widget-getting-started.md)
- [Edit, Clone, and Delete widget](/edit-clone-and-delete.md)
