Skip to content

How to Rename Rules

0xharkirat edited this page Sep 25, 2026 · 10 revisions

Renaming SSW Rules and their URLs

Video: How to rename a rule

Video: How to rename an SSW Rule?

Step 1: Update the title text

  1. Change the title: field in the frontmatter

Step 2: Update the URI + Add the redirect from old URI

  1. Change the uri: field in the frontmatter
  2. Add the old URI to the redirects: list in the rule

For example, this rule was changed from:

Path: public/uploads/rules/accommodation---do-you-know-the-best-online-accommodation-websites/rule.mdx

---
type: rule
title: Accommodation - Do you know the best online accommodation websites?
guid: 8d59feea-03b4-4cfc-b26e-77b2655293d9
uri: accommodation---do-you-know-the-best-online-accommodation-websites
redirects: []
---

To:

Path: public/uploads/rules/the-best-accommodation-websites/rule.mdx

---
type: rule
title: Accommodation - Do you know the best online accommodation websites?
guid: 8d59feea-03b4-4cfc-b26e-77b2655293d9
uri: the-best-accommodation-websites
redirects: 
 - accommodation---do-you-know-the-best-online-accommodation-websites
---

Step 3: Rename the folder in GitHub

Rename the rule's folder to be the same as the new URI

  1. Open the rule in GitHub
  2. Click the 'Edit' button
image

Figure: Open the Editor in GitHub

  1. Click the file name at the top of the editor
  2. Move the cursor to the start of this field
image

Figure: Place your cursor in the file editor

  1. Press 'backspace' on your keyboard to open the editor field for the folder name
  2. Change the folder name
image

Figure: Pressing 'backspace' will move the editor field to the folder

  1. Press '/' on your keyboard to navigate back to the file name
  2. Ensure the file name is the same as before (usually 'rule.mdx')
image

Figure: Press '/' and make sure the file name is correct

  1. Save your changes at the bottom of the page as you would with any other change

Step 4: Find and update rules' categories

To find all the categories that this rule is in, follow these steps:

  1. Navigate to the rule on ssw.com.au/rules
  2. Click on the category in the breadcrumb
image
  1. In the category, click the github button in the top right. You will be navigated to the category file in GitHub

  2. Open the same file in your fork of the repository

  3. Click the edit pencil

  4. Find the old URI in the index and change it to the new one

  5. If there is more than one category in the breadcrumb like this in step 2, repeat steps 2 - 6 for each category

  6. Search the repository for the old URI and update every other match, such as other rules' related: entries and image paths (/uploads/rules/<old-uri>/...). When you're done, the only match left is the redirects: entry from Step 2:

    git grep -n "<old-uri>"

Step 5: Deploy SSW.Rules so the redirect starts working

Merging your pull request does not deploy the whole site. The new URL shows up soon after merge, but the redirect from the old URL only starts working after the next production deploy of SSW.Rules. Until then, the old URL keeps showing the old version of the rule.

Production deploys run automatically every day at 06:00 UTC (4pm AEST, 5pm AEDT). If the old URL needs to redirect sooner, run the deploy yourself (needs write access to SSW.Rules):

  1. Open Actions | Scheduled Production Deploy in SSW.Rules

  2. Click Run workflow | Run workflow

    Or, from a terminal:

    gh workflow run scheduled-production-deploy.yml -R SSWConsulting/SSW.Rules
  3. Wait for the Deploy Application to Azure Web App (Container) run it starts to finish (about 40 minutes)

  4. Open the old URL and check that it redirects to the new one

If you can't run the deploy, say so in your pull request so the reviewer knows the old URL won't redirect until the next daily deploy.

SSW.Rules#2722 tracks removing the need for this step.

Clone this wiki locally