Hi,
I’ve imported my forum Mybb to Discourse. My Discourse is now working on production server. My old url’s can’t redirect to new Discourse urls. I check import script. There is some codes for redirects url, it seems doesn’t work for me. How can i fix that? How can i redirect old urls to new in a mass?
Why this is doesnt work for me? My Mybb forum url structure is like that: /thread-title.html
or /thread-title-id.html
# frozen_string_literal: true
require "mysql2"
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
# Before running this script, paste these lines into your shell,
# then use arrow keys to edit the values
=begin
export DB_HOST="localhost"
export DB_NAME="mybb"
export DB_PW=""
export DB_USER="root"
export TABLE_PREFIX="mybb_"
export UPLOADS_DIR="/data/youruploads"
export BASE="" #
=end
# Call it like this:
# RAILS_ENV=production ruby script/import_scripts/mybb.rb
class ImportScripts::MyBB < ImportScripts::Base
This file has been truncated. show original
pfaffman
(Jay Pfaffman)
September 6, 2017, 4:23pm
2
So your old urls look like
http://example.com/thread-1234.html
or do they look like
http://example.com/thread-the-title-of-the-post-1234.html
or do they look like
http://example.com/thread-title-1234.html
It is like that:
http://sub.site.com/thread-the-title-of-the-post.html
In the Turkish language thread means “konu”. So it is exactly:
http://forum.site.com/konu-the-title-of-the-post.html
pfaffman
(Jay Pfaffman)
September 6, 2017, 5:28pm
4
Does “the-title-of-the-post” match exactly the slug in Discourse?
Yes it is match exactly.
“the-title-of-the-post” in the url exactly match for topic url’s. Anyway, i just want to redirect for topics. Category or other page is doesnt matter.
It is out of budget, but even so, thank you for all answers and support.