<?php
/* ----------------------------------------------------------- *\
This variable defines where XenForo is installed.
If you have not installed XenForo into the same directory in which
vBulletin was installed, you will need to provide the full path to
the XenForo directory here. Remove the leading // and then enter
the path as in the following examples:
#
# $fileDir = '/home/example/public_html/new_forums';
#
# $fileDir = 'C:/inetpub/wwwroot/xenforo';
#
\* ----------------------------------------------------------- */
$fileDir = '/home/nginx/domains/v6mustang.com/public';
/* ----------------------------------------------------------- *\
This constant defines the table from which the import redirection
scripts will fetch their data. Normally they will use the table
'xf_import_log', but if you have archived your import data, you
should provide the name of the archive table here. Remove the
leading // and then replace 'import_log_x' with the name of your
archive table, as in the following examples:
#
# define('IMPORT_LOG_TABLE', 'my_import_log');
#
# define('IMPORT_LOG_TABLE', 'import_log_my_forums');
#
\* ----------------------------------------------------------- */
define('IMPORT_LOG_TABLE', 'archived_import_log_v6mfxen');
/* ----------------------------------------------------------- *\
This constant controls whether or not to include page number links
in your redirects. In order for this to work, the number of posts
shown per page in vBulletin MUST match the number of posts shown per
page in XenForo, and the number of threads shown per page on
vBulletin's thread listing pages must be the same as that used by
XenForo, or the links will be wrong. If they do not match, leave
this constant defined as 'false'. If they do match, change the
definition to 'true'.
\* ----------------------------------------------------------- */
define('INCLUDE_PAGE_LINKS', false);
<?php
$startTime = microtime(true);
$fileDir = dirname(__FILE__);
if (file_exists($fileDir . '/301config_phpbb.php'))
{
include($fileDir . '/301config_phpbb.php');
}
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
$inputHandler = new XenForo_Input(new Zend_Controller_Request_Http());
$input = $inputHandler->filter(array(
't' => XenForo_Input::UINT,
'p' => XenForo_Input::UINT,
'page' => XenForo_Input::UINT,
));
$importModel = XenForo_Model::create('XenForo_Model_Import');
$target = false;
if ($input['t'])
{
if ($newId = $importModel->mapThreadId($input['t']))
{
$data = array('thread_id' => $newId);
$extraParams = array();
if (defined('INCLUDE_PAGE_LINKS') && INCLUDE_PAGE_LINKS && $input['page'])
{
$extraParams['page'] = $input['page'];
}
$target = XenForo_Link::buildPublicLink('canonical:threads', $data, $extraParams);
}
}
else if ($input['p'])
{
$newId = $importModel->mapPostId($input['p']);
if ($newId)
{
$target = XenForo_Link::buildPublicLink('canonical:posts', array('post_id' => $newId));
}
}
if (!$target)
{
$target = XenForo_Link::buildPublicLink('canonical:index');
}
$response = new Zend_Controller_Response_Http();
$response->setRedirect(XenForo_Link::convertUriToAbsoluteUri($target), 301);
$response->sendResponse();
if ($args ~ "(^|&)t=([0-9]+)(&|$)"){
set $rule_0 1$rule_0;
set $bref_2 $2;
}
if ($rule_0 = "1"){
rewrite ^/viewtopic.php$ /showthread_phpbb.php?t=$bref_2 permanent;
}
I'm seeing this as a possible rewrite:
Does that help?Code:location / { if ($query_string ~ "(^|&)t=([0-9]+)(&|$)"){ rewrite ^/viewtopic.php$ /showthread_phpbb.php?t=%2 redirect; } }
#301 redirect non-www to www
server {
server_name v6mustang.com;
rewrite ^ http://www.v6mustang.com$request_uri? permanent;
}
server {
server_name www.v6mustang.com;
# ngx_pagespeed & ngx_pagespeed handler
include /usr/local/nginx/conf/pagespeed.conf;
include /usr/local/nginx/conf/pagespeedhandler.conf;
include /usr/local/nginx/conf/pagespeedstatslog.conf;
# limit_conn limit_per_ip 16;
# ssi on;
access_log /home/nginx/domains/v6mustang.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/v6mustang.com/log/error.log;
root /home/nginx/domains/v6mustang.com/public;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
# block common exploits, sql injections etc
#include /usr/local/nginx/conf/block.conf;
# Enables directory listings when index file not found
#autoindex on;
# Shows file listing times as local time
#autoindex_localtime on;
# Enable for vBulletin usage WITHOUT vbSEO installed
#try_files / /index.php;
if ($query_string ~ "(^|&)t=([0-9]+)(&|$)"){
rewrite ^/viewtopic.php$ /showthread_phpbb.php?t=%2 redirect;
}
}
location /internal_data/ {
internal;
}
location /library/ {
internal;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /vb/ {
rewrite ^/vb/f[\d]+/.+-([\d]+)/index([\d]+).html /vb/showthread.php?t=$1&page=$2 last;
rewrite ^/vb/f[\d]+/.+-([\d]+)/ /vb/showthread.php?t=$1 last;
rewrite ^/vb/f([\d]+)/index([\d]+).html /vb/forumdisplay.php?f=$1&page=$2 last;
rewrite ^/vb/f([\d]+)/ /vb/forumdisplay.php?f=$1 last;
}
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;
}
I suppose you could just create the necessary PHP file directly and then just manipulate $_GET as necessary and then require showthread_phpbb.php - skip the rewrites entirely...
I suppose you could just create the necessary PHP file directly and then just manipulate $_GET as necessary and then require showthread_phpbb.php - skip the rewrites entirely...
We use essential cookies to make this site work, and optional cookies to enhance your experience.