2015-04-26 38 views
1

我試圖htacces PHPBB到xenforo

http://www.example.com/fraiseuses/restauration-gambin-10n-t33924-45.html 
http://www.example.com/fraiseuses/une-gambin-10n-plus-sur-forum-t34642.html#p675680 

重定向放入系統的網址(從phphbb)到正確的xenforo網址

http://www.example.com/threads/restauration-gambin-10n.33924/page-3 
http://www.example.com/threads/34642/page-1#post-675680 

我htacces

RewriteEngine On 

RewriteRule ^post([0-9]+).html$ /posts/$1 [R=301,L] 
RewriteRule ^.*-f([0-9]+)$ /forums/$1 [R=301,L] 
RewriteRule ^[^/]+/topic([0-9]+).html /threads/$1 [R=301,L] 
RewriteRule ^.*-t([0-9]+).html /threads/$1 [R=301,L] 


RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-15\.html$ /threads/$1/page-1 [R=301,L] 
RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-30\.html$ /threads/$1/page-2 [R=301,L] 
RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-45\.html$ /threads/$1/page-3 [R=301,L] 

不幸的是我找不到我的錯誤,請問有人能指出我的錯誤嗎?謝謝。

回答

1

沒有phpBB的特定重定向腳本,但這些工作::

http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

這些腳本的基本功能是老ID映射到新的。根據適當的重寫規則,他們可以使用phpBB URL。下面是步驟你:

1)上傳這些重定向腳本舊論壇的位置(/論壇文件夾):

http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

你只需要301config.php文件和showthread.php文件重定向線程(這是最重要的事情)。

2)編輯301config.php文件。取消註釋該行(刪除//),並指定到您的XF目錄的路徑:

// $fileDir = '/home/username/www/forums'; 

您可能還需要指定導入日誌表的名稱,如果它不是默認的(xf_import_log)。它可能被命名爲archived_import_log:

// define('IMPORT_LOG_TABLE', 'import_log_x'); 

3)添加這些重寫規則在/論壇目錄.htaccess文件。這是基於以前的phpBB導入。我假設你的網址遵循相同的格式:

RewriteEngine on 

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

THX

我這樣做:

RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC] 
    RewriteRule ^viewtopic\.php$ /threads/%2? [L,R=301,NC] 
    RewriteCond %{QUERY_STRING} (^|&)p=([0-9]+)(&|$) [NC] 
    RewriteRule ^viewtopic\.php$ /posts/%2? [L,R=301,NC] 
    RewriteCond %{QUERY_STRING} f=(\d+)$ [NC] 
    RewriteRule ^viewforum\.php$ /forums/%1 [L,R=301,NC] 
    RewriteRule ^viewforum\.php$ /forums/%1? [L,R=301,NC]