# Permalink Wildcards

**URL:** https://meta.discourse.org/t/permalink-wildcards/110998
**Category:** Support
**Created:** [March 7, 2019, 4:51pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998 "2019-03-07T16:51:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![DigitalStartup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/digitalstartup/32/118242_2.png) [@DigitalStartup](https://meta.discourse.org/u/DigitalStartup)
#### Post date: [March 7, 2019, 4:51pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998/1 "2019-03-07T16:51:56Z")

</div>

Soon, I’ll be replacing my Wordpress site with Discourse. Rather than set up a Permalink _**(or simple 301 redirect)**_ for each URL individually, can I setup a wildcard to capture multiple pages at once? If not, is there a way I can import this data to speed up the process?

_Example scenario:_

| Old Wordpress URLs | Discourse Topic ID |
| --- | --- |
| `/example-a` | 100 |
| `/example-a/example1.html` | 100 |
| `/example-a/example2.html` | 100 |
| `/example-a/example3.html` | 100 |
| `/example-a/example4.html` | 100 |
| `/example-b` | 200 |
| `/example-b/example1.html` | 200 |
| `/example-b/example2.html` | 200 |
| `/example-b/example3.html` | 200 |
| `/example-b/example4.html` | 200 |

_Visually:_

 ![Untitled%20Diagram](https://global.discourse-cdn.com/meta/original/3X/a/e/ae2d2c98b60065ff5c0f9d47d3a2bc85b8f2ab72.png)

Therefore any URL starting “`example-a`” would go to `100` and “`example-b`” would go to `200`

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 7, 2019, 5:00pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998/2 "2019-03-07T17:00:07Z")

</div>

See the `permalink normalizations` site setting. Note that permalinks work only for links coming in to the site from outside. They will not work for internal links. You’ll need to rewrite those in `raw`.

---

<div class="post-metadata">

### Author: ![DigitalStartup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/digitalstartup/32/118242_2.png) [@DigitalStartup](https://meta.discourse.org/u/DigitalStartup)
#### Post date: [March 7, 2019, 5:30pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998/3 "2019-03-07T17:30:40Z")

</div>

Please, can you expand on your answer. I’ve updated the question for clarity.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [March 7, 2019, 6:21pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998/4 "2019-03-07T18:21:09Z")

</div>

Did you look at` /admin/site_settings/category/all_results?filter=permalink`?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 7, 2019, 6:22pm UTC](https://meta.discourse.org/t/permalink-wildcards/110998/5 "2019-03-07T18:22:05Z")

</div>

Does this explanation of `permalink normalizations` not help?

> [@](#):
>
> Apply the following regex before matching permalinks, for example: /(topic._)?._/\1 will strip query strings from topic routes. Format is regex+string use \1 etc. to access captures

So you’d do something like

```
/(example-*)\?.*/\1

```

so all of the `example[123]*` would be removed before it’s matched against the permalinks.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 19, 2022, 7:45am UTC](https://meta.discourse.org/t/permalink-wildcards/110998/6 "2022-04-19T07:45:05Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 19, 2022, 9:22am UTC](https://meta.discourse.org/t/permalink-wildcards/110998/7 "2022-04-19T09:22:52Z")

</div>


