Skip to content

URL Rewrites (After Migration)#

This guide describes the possibility after a software change or migration from an older software version to automatically redirect old links to content such as threads to the new link structure so that old links remain accessible.

Hinweis

This article is intended for customers who run the software independently on their own server or web hosting.

The examples shown here are based on the standard installation. Depending on the number of installed packages and the type of paths used, the rewrite rules have to be adapted accordingly.

Rewrite rules for Apache / Litespeed can be created via a .htaccess file. If already existing, open the .htaccess file, which is located in the main directory of your WoltLab Suite installation, and add the rewrite rules below at the beginning of the file. If no .htaccess file exists yet, you can create one with any text editor.

Burning Board 4.x#

Apache / Litespeed#

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^calendar/index.php/(.*) calendar/index.php?$1 [L,QSA]

RewriteRule ^gallery/index.php/(.*) gallery/index.php?$1 [L,QSA]

RewriteRule ^filebase/index.php/(.*) filebase/index.php?$1 [L,QSA]

RewriteRule ^index.php/(.*) forum/index.php?$1 [L,QSA]
</IfModule>

Nginx#

location /calendar {
    rewrite ^/calendar/index.php/(.*) /calendar/index.php?$1 break;
}
location /gallery {
    rewrite ^/gallery/index.php/(.*) /gallery/index.php?$1 break;
}
location /filebase {
    rewrite ^/filebase/index.php/(.*) /filebase/index.php?$1 break;
}
location /index {
    rewrite ^/index.php/(.*) /forum/index.php?$1 break;
}

Burning Board 3.x#

Apache / Litespeed#

Without Burning Board 3 SEO Plugin#

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Burning Board 3
RewriteCond %{QUERY_STRING} page=User&userID=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?user/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&threadID=([0-9]+)&action=lastPost
RewriteRule ^index\.php$ /forum/index.php?thread/%1/&action=lastPost [R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&threadID=([0-9]+)&action=firstNew
RewriteRule ^index\.php$ /forum/index.php?thread/%1/&action=firstNew [R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&postID=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?thread/thread/&postID=%1#post%1 [NE,R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&postID=([0-9]+)#post([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?thread/thread/&postID=%1#post%1 [NE,R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&threadID=([0-9]+)&pageNo=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?thread/%1/&pageNo=%2 [R=301,L]
RewriteCond %{QUERY_STRING} page=Thread&threadID=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?thread/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=Board&boardID=([0-9]+)&pageNo=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?board/%1/&pageNo=%2 [R=301,L]
RewriteCond %{QUERY_STRING} page=Board&boardID=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?board/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=Attachment&attachmentID=([0-9]+)
RewriteRule ^index\.php$ index.php?attachment/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=Index
RewriteRule ^index\.php$ /forum/index.php?board-list/ [R=301,L]
RewriteCond %{QUERY_STRING} page=Portal
RewriteRule ^index\.php$ index.php?dashboard/ [R=301,L]

# Community Blog 2
RewriteCond %{QUERY_STRING} page=UserBlogOverview
RewriteRule ^index\.php$ /blog/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserBlogEntry&entryID=([0-9]+)
RewriteRule ^index\.php$ /blog/index.php?entry/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserBlog&userID=([0-9]+)&categoryID=([0-9]+)
RewriteRule ^index\.php$ /blog/index.php?entry-list/&userID=%1 [R=301,L]
RewriteCond %{QUERY_STRING} page=UserBlogOverview&categoryID=([0-9]+)
RewriteRule ^index\.php$ /blog/index.php?entry-list/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserBlog&userID=([0-9]+)
RewriteRule ^index\.php$ /blog/index.php?entry-list/&userID=%1 [R=301,L]

# Community Gallery 2
RewriteCond %{QUERY_STRING} page=UserGalleryOverview
RewriteRule ^index\.php$ /gallery/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserGalleryAlbumList&userID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?album/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserGalleryPhotos&userID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?user-image-ist/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserGalleryPhoto&photoID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?image/%1/ [R=301,L]
RewriteCond %{QUERY_STRING} page=UserGalleryPhotos&albumID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?album/%1/ [R=301,L]

# Community Calendar 2
RewriteCond %{QUERY_STRING} page=CalendarMonth
RewriteRule ^index\.php$ /calendar/ [R=301,L]
RewriteCond %{QUERY_STRING} page=CalendarWeek
RewriteRule ^index\.php$ /calendar/index.php?weekly/ [R=301,L]
RewriteCond %{QUERY_STRING} page=CalendarEvent&eventID=([0-9]+)
RewriteRule ^index\.php$ /calendar/index.php?event/%1/ [R=301,L]
</IfModule>

With Burning Board 3 SEO Plugin#

<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Burning Board
RewriteRule ^user/([0-9]+)\-([^/\.]*)/?$ /forum/index.php/User/$1-$2/ [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/([0-9]+)\-([^/\.]*)/last\-post\.html$ /forum/index.php?thread/$4-$5/&action=lastPost [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/([0-9]+)\-([^/\.]*)/first\-new\-post\.html$ /forum/index.php?thread/$4-$5/&action=firstNew [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/p([0-9]+)\-([^/\.]*)/?$ /forum/index.php?thread/&postID=$4#post$4 [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/([0-9]+)\-([^/\.]*)/index([0-9]+)\.html$ /forum/index.php?thread/$4-$5/&pageNo=$6 [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/([0-9]+)\-([^/\.]*)/?$ /forum/index.php?thread/$4-$5/ [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/index([0-9]+)\.html$ /forum/index.php?board/$2-$3/&pageNo=$4 [R=301,QSA,L]
RewriteRule ^(board[0-9]+\-[^/\.]+/)*board([0-9]+)\-([^/\.]+)/?$ /forum/index.php?board/$2/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} page=Attachment&attachmentID=([0-9]+)
RewriteRule ^index\.php$ /forum/index.php?attachment/%1/ [R=301,QSA,L]

# Community Blog
RewriteRule ^user/blog([0-9]+)\-([^/\.]*)/entry([0-9]+)\-([^/\.]*)/?$ /blog/index.php?entry/$3-$4/ [R=301,QSA,L]
RewriteRule ^user/blog([0-9]+)\-([^/\.]*)/category([0-9]+)\-([^/\.]*)/?$ /blog/index.php?entry-list/&userID=$1 [R=301,QSA,L]
RewriteRule ^blog/category([0-9]+)\-([^/\.]*)/?$ /blog/index.php??entry-list/$1/ [R=301,QSA,L]
RewriteRule ^user/blog([0-9]+)\-([^/\.]*)/?$ /blog/index.php?entry-list/&userID=$1 [R=301,QSA,L]
RewriteCond %{QUERY_STRING} page=UserBlogOverview
RewriteRule ^index\.php$ /blog/ [R=301,QSA,L]

# Community Gallery
RewriteRule ^user/gallery([0-9]+)/([^/\.]*)/photo([0-9]+)/([^/\.]*)/?$ /gallery/index.php?image/$3-$4/ [R=301,QSA,L]
RewriteRule ^user/gallery([0-9]+)/([^/\.]*)/album([0-9]+)/([^/\.]*)/?$ /gallery/index.php/Album/$3-$4/ [R=301,QSA,L]
RewriteRule ^gallery/category([0-9]+)/([^/\.]*)/?$ /gallery/index.php?image-list/$1-$2/ [R=301,QSA,L]
RewriteRule ^user/gallery([0-9]+)/([^/\.]*)/?$ /gallery/index.php?image/$3-$4/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} page=UserGalleryOverview
RewriteRule ^index\.php$ /gallery/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} page=UserGalleryAlbumList&userID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?album-list/%1/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} page=UserGalleryPhotos&userID=([0-9]+)
RewriteRule ^index\.php$ /gallery/index.php?user-image-list/%1/ [R=301,QSA,L]
</ifmodule>

Burning Board 2.x#

Apache / Litespeed#

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} userid=([0-9]+)
RewriteRule ^profile\.php$ index.php?user/%1/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} goto=lastpost&threadid=([0-9]+)
RewriteRule ^thread\.php$ /forum/index.php?thread/%1/&action=lastPost [R=301,QSA,L]
RewriteCond %{QUERY_STRING} threadid=([0-9]+)&goto=lastpost
RewriteRule ^thread\.php$ /forum/index.php?thread/%1/&action=lastPost [R=301,QSA,L]
RewriteCond %{QUERY_STRING} postid=([0-9]+)#post([0-9]+)
RewriteRule ^thread\.php$ /forum/index.php?thread/&postID=%1#post%1 [NE,R=301,L]
RewriteCond %{QUERY_STRING} postid=([0-9]+)
RewriteRule ^thread\.php$ /forum/index.php?thread/&postID=%1#post%1 [NE,R=301,L]
RewriteCond %{QUERY_STRING} threadid=([0-9]+)page=([0-9]+)
RewriteRule ^thread\.php$ /forum/index.php?thread/%1/&pageNo=%2 [R=301,QSA,L]
RewriteCond %{QUERY_STRING} threadid=([0-9]+)
RewriteRule ^thread\.php$ /forum/index.php?thread/%1/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} boardid=([0-9]+)&daysprune=1000&sortfield=lastposttime&sortorder=DESC&page=([0-9]+)
RewriteRule ^board\.php$ /forum/index.php?board/%1/&pageNo=%2 [R=301,QSA,L]
RewriteCond %{QUERY_STRING} boardid=([0-9]+)
RewriteRule ^board\.php$ /forum/index.php?board/%1/ [R=301,QSA,L]
RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)
RewriteRule ^attachment\.php$ index.php?attachment/%1/ [R=301,QSA,L]

RewriteRule ^archive/index\.html$ index.php?board-list/ [R=301,QSA,L]
RewriteRule ^archive/([0-9]*)/board\.html$ /forum/index.php?board/%1/ [R=301,QSA,L] 
RewriteRule ^archive/([0-9]*)/([0-9]*)/board\.html$ /forum/index.php?board/%1/&pageNo=%2 [R=301,QSA,L] 
RewriteRule ^archive/([0-9]*)/thread\.html$ /forum/index.php?thread/%1/ [R=301,QSA,L] 
RewriteRule ^archive/([0-9]*)/([0-9]*)/thread\.html$ /forum/index.php?thread/%1/&pageNo=%2 [R=301,QSA,L]
</IfModule>

vBulletin 3.x/4.x#

Apache / Litespeed#

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^f=([0-9]+)$
RewriteRule ^forumdisplay\.php$ forum/index.php?board/%1/ [R=301,L]

RewriteCond %{QUERY_STRING} ^p=([0-9]+)$
RewriteRule ^showthread\.php$ forum/index.php?thread/&postID=%1#post%1 [NE,R=301,L]

RewriteCond %{QUERY_STRING} ^([0-9]+)-([^/\.]+)&goto=newpost$
RewriteRule ^showthread\.php$ forum/index.php?thread/%1-%2/&action=firstNew [R=301,L]

RewriteCond %{QUERY_STRING} ^t=([0-9]+)&p=([0-9]+)
RewriteRule ^showthread\.php$ forum/index.php?thread/%1/&postID=%2#post%2 [NE,R=301,L]

RewriteCond %{QUERY_STRING} ^t=([0-9]+)&page=([0-9]+)
RewriteRule ^showthread\.php$ forum/index.php?thread/%1/&pageNo=%2 [R=301,L]

RewriteCond %{QUERY_STRING} ^p=([0-9]+)&postcount=([0-9]+)$
RewriteRule ^showpost\.php$ forum/index.php?thread/&postID=%1#post%1 [NE,R=301,L]

RewriteCond %{QUERY_STRING} ^t=([0-9]+)
RewriteRule ^showthread\.php$ forum/index.php?thread/%1/ [R=301,L]

RewriteCond %{QUERY_STRING} ^attachmentid=([0-9]+)&d=([0-9]+)$
RewriteRule ^attachment\.php$ index.php?attachment/%1/ [R=301,L]

RewriteCond %{QUERY_STRING} ^([0-9]+)-([^/\.]+)$
RewriteRule ^member\.php$ index.php?user/%1-%2/ [R=301,L]

RewriteCond %{QUERY_STRING} ^do=getnew&contenttype=vBForum_Post$
RewriteRule ^search\.php$ index.php?board-quick-search/&mode=unreadPosts [R=301,L]

RewriteRule ^forum\.php$ forum/index.php?board-list/ [R=301,L]

RewriteRule ^online\.php$ index.php?users-online-list/ [R=301,L]

RewriteRule ^activity\.php$ index.php?dashboard/ [R=301,L]
</IfModule>

phpBB 3.x#

Apache / Litespeed#

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 

RewriteCond %{QUERY_STRING} ^p=([0-9]+).*$ 
RewriteRule ^viewtopic\.php$ forum/index.php?thread/&postID=%1#post%1 [R=301,L] 

RewriteCond %{QUERY_STRING} ^f=([0-9]+).*$ 
RewriteRule ^viewforum\.php$ forum/index.php?board/%1/ [R=301,L] 

RewriteCond %{QUERY_STRING} ^f=([0-9]+)&t=([0-9]+).*$ 
RewriteRule ^viewtopic\.php$ forum/index.php?thread/%2/ [R=301,L] 

RewriteCond %{QUERY_STRING} ^t=([0-9]+).*$ 
RewriteRule ^viewtopic\.php$ forum/index.php?thread/%1/ [R=301,L] 

RewriteCond %{QUERY_STRING} ^mode=viewprofile&u=([0-9]+).*$ 
RewriteRule ^memberlist\.php$ index.php?user/%1/ [R=301,L] 
</IfModule> 

XenForo 2.x#

Apache / Litespeed#

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 

RewriteRule ^members/([^/]*)\.([0-9]+)/$ index.php?user/$2/ [R=301,L]
RewriteRule ^attachments/([^/]*)\.([0-9]+)/$ index.php?attachment/$2/ [R=301,L]
RewriteRule ^categories/([^/]*)\.([0-9]+)/$ forum/index.php?board/$2/ [R=301,L]
RewriteRule ^forums/([^/]*)\.([0-9]+)/$ forum/index.php?board/$2/ [R=301,L]
RewriteRule ^threads/([^/]*)\.([0-9]+)/page-([0-9]+)$ forum/index.php?thread/$2/&pageNo=$3 [R=301,L]
RewriteRule ^threads/([^/]*)\.([0-9]+)/post-([0-9]+)$ forum/index.php?thread/$2/&postID=$3 [R=301,L]
RewriteRule ^threads/([^/]*)\.([0-9]+)/$ forum/index.php?thread/$2/ [R=301,L]
</IfModule>