Another permalink question - using a regex

Hi,

Whenever I search on google for topics that have been on the old community but have been migrated, google returns something like

Of course all these links lead to a 404 because the path Welcome to the new Exalate community - Site Feedback - Exalate doesn’t exist

Is there a way to add a regexp to the permalinks, such that whenever someone searches for

https://community.exalate.com/questions/20123204/stop-syncing

The request is automatically redirected to a topic/wiki page explaining the situation?

I think the best way to do this is with a Permalink Normalisation

(i.e. strip off everything after /questions then add a Permalink for that path)

2 Likes

Did you import /20123204/stop-syncing? If so, and you did it with something that used the import script base.rb then you should be able to make those go the right place

No idea what import base.rb is.

All these topics have been imported using the API.
Can you give a pointer for details?

Thanks!

Oh. Then you don’t have import_id; that’s one more reason that imports with the API are a bad idea.

You’d need to create permalinks (admin /customize/permalinks) for the posts you imported. But you could use a single permalink redirect to catch them all and point them to a single place.

1 Like

Hi,

I added

‘questions,’ pointing to a topic but that doesn’t resolve it.

To be honest, the ‘permalink normalization’ description is exceeding my intellectual capacity to understand :sweat: so probably I’m missing the point.

What should I enter in the permalink interface so that any request to …/questions/… gets mapped to a single topic?

Alright, our posts crossed.
What is the magic to get that working?

Something like

/question\/.*/your-url

1 Like

Hi Francis :wave: I’ve converted this into a private message with our support inbox. In the future, you can send a PM to team directly or email team@discourse.org for requests like this.

It seems that you already got support from the community :slightly_smiling_face: but if you need any further information or help please do let us know.

1 Like

Ok, thanks for letting me know.

Hi yigit

I don’t have a solution yet.
When I try questions/.* as source url, requests to community.exalate.com/questions/blah are not redirected.

Is there something I need to take into account.

Oh okay. Thank you for letting us know Francis.

I’ve tried some combinations, but I can’t manage to get the expected results so far. Let me consult internally to find out an applicable option. We will get back to you as soon as possible once we have an update for you. :+1:

Lily is also working the case …

···

On Mon, Nov 18, 2024, 16:57 Discourse Team <team@discourse.org> wrote:

Please type your reply above this line.

| Yiğit Mersin yigit team
November 18 |

  • | - |

Oh okay. Thank you for letting us know Francis.

I’ve tried some combinations, but I can’t manage to get the expected results so far. Let me consult internally to find out an applicable option. We will get back to you as soon as possible once we have an update for you. :+1:


Reply to this email to respond to Discourse Team (98).

Legal Disclaimer

Hi Francis,

The normalizations are an advanced feature in a different spot - I only knew about them and hadn’t used them myself yet. They’re in site settings, not in the Permalink interface.

Try this:

I’ve done this on our demo site https://try.discourse.org and it works as follows:

○ → curl -i https://try.discourse.org/questions/do/you/wanna/build/a/snowman
HTTP/2 301 
…
x-discourse-route: permalinks/show
location: https://try.discourse.org/t/whoa-check-out-this-crazy-paper-artwork/77
…

That site will reset overnight (as usual) and that’ll vanish, but this should do what you need on your site.

3 Likes

Solved.

Hi @pfaffman - I first didn’t get your suggestion, but @supermathie screenshot turned on the light.

Thanks all for the help

4 Likes