Permalink Wildcards

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

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

1 Like

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.

5 Likes

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

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

3 Likes

Does this explanation of permalink normalizations not help?

So you’d do something like

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

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

3 Likes