Redirecting the old forum urls to the discourse

I am trying to migrate from WordPress based forum to Discourse .

My old url is like this

https://example.com/question/questioncontent

And in discourse I see topics are created with uri

https://example.com/t/questioncontent

So I copied entire content from my old forum to new forum
Im not that techy so I don’t wanted to take risk I have about 18 posts so I didn’t went with any scripts . I copied all the content manually.

Now my question is how can I redirect
My old forum links which are already indexed in search engines.

I tried permalink feature to redirect , but still I am not able to redirect

Did I missed something? Anywhere please guide me with the correct procedure

1 Like

See admin -> customize -> permalinks. You can create a redirect from the 18 old URLs to their new topics.

4 Likes

I tried unfortunately they are not redirected

Any help? This is not working for me

1 Like

I have written a plugin to do so.
https://github.com/paviliondev/discourse-articles

https://github.com/paviliondev/discourse-articles/blob/8a79f4eeff6399cfe1cbbd738a847080c8e8fef2/plugin.rb#L17

Change the above to:
get '/question/:slug', to: redirect('/t/%{slug}')

2 Likes

Thanks will try and let u know

1 Like

I cannot imagine why not, but it’s impossible to tell without more information about what you did. I cannot imagine why you’d need a plug-in, though. For 18 you can just create them by hand, though you could possibly use a permalink normalization to do them all at once.

Edit: permalink works only for incoming links, not links within discourse. What is usually done is to rewrite those links in the posts.

I was redirecting my old forum urls to discourse one. Dont know why its not working for me.

i wanted to confirm
suppose my old url is 1. forum.example.com/must-read-rules
and discourse one is 2. forum.example.com/t/must-read-rules/47

i have to enter this 1. in New field and 2 in destination field am i right?

Sry for dumb question!

You’d enter must-read-rules in the URL field , leave the “topic ID” selected, and put 47 in the topic ID field. Like this:

1 Like

The redirect option under customize option is not working for me.

How can I make it work?

Are you trying to use it to redirect inbound links to discourse content, or to redirect links within discourse (i.e between pages).

1 Like

Right! Permalink works only for incoming URLs. I bet this is the problem.

1 Like

@pfaffman @Stephen Im migrating from wordpress to discourse. I m redirecting my old urls to discourse generated urls.

ex: forum.example.com/question/hey to forum.example.com/t/hey

Inbound links will be redirected by the permalinks feature. Internal links between posts will need to be corrected to reflect their new destination, permalink redirection won’t work there.

1 Like

What are the possible ways to make it work?
the first url was my previous wordpress forum one and second url is my discourse one
How can i redirect successfully.

Can u please tell me how can i edit the code any guide? i installed the plugin but i didnt found specific area which u are referring to edit the slug?

1 Like

Tried unfortunately not working :pensive:

You’ll have to fork the plugin.

1 Like

Can I add multiple urls there?
Or only structure of url?