XenForo Redirects for vBulletin

XenForo Redirects for vBulletin 1.1.9

No permission to download
I recently changed from Apache to Nginx, and now I can't find the correct Nginx config to get the redirects working again.

Situation:

Old vBulletin = https://olddomain.com/forum
New XF forum = https://newdomain.com

I tried placing the index.php script in https://olddomain.com/
And than added this to the vhost config of olddomain.com:
Code:
location / {
       index index.php
    try_files $uri $uri/ /index.php?$uri&$args;
}

..but this gives a 404 when testing.
 
So if I understand correctly, nobody ever got the vBulletin redirect addon working correctly with Nginx (I'm running Centminmod)?
I found some hints in this topic, but unfortunately non of them are working correctly.
 
Was it working properly on Apache?

Using the following on nginx:
Code:
location / {
    try_files $uri $uri/ /index.php?$uri&$args;
    index index.php index.html;
}
Maybe some other issues in configuration are making problems, such as location ~ \.php$ block.
 
Yep, this all worked fine with Apache. I still have a copy of the site running, so I can check things.

The most basic test:

Running Apache: https://mydomain.com/showthread.php?t=14884 redirects to https://mydomain.com/threads/topic-title.<newID>
Running Nginx: https://mydomain.com/showthread.php?t=14884 gives a error 404

I am using this in the nginx vhost config:
Code:
  location / {
    index index.php;
    try_files $uri $uri/ /index.php?$uri&$args;
  }

There is also a php config included which looks like this:
Code:
location ~ [^/]\.php(/|$) {
  include /usr/local/nginx/conf/503include-only.conf;
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }
    fastcgi_pass dft_php;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME    $request_filename;

fastcgi_connect_timeout 360s;
fastcgi_send_timeout 360s;
fastcgi_read_timeout 360s;
fastcgi_buffer_size 32k;
fastcgi_buffers 512 32k;
fastcgi_busy_buffers_size 1m;
fastcgi_temp_file_write_size 4m;
fastcgi_max_temp_file_size 4m;
fastcgi_intercept_errors off;

fastcgi_param HTTPS $server_https;

fastcgi_param  PATH_INFO          $fastcgi_path_info;
fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_path_info;

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;
fastcgi_param  HTTP_PROXY         "";

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
fastcgi_param GEOIP_COUNTRY_CODE3 $geoip_country_code3;
fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;
fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code;
fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3;
fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name;
fastcgi_param GEOIP_REGION $geoip_region;
fastcgi_param GEOIP_CITY $geoip_city;
fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code;
fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code;
fastcgi_param GEOIP_LATITUDE $geoip_latitude;
fastcgi_param GEOIP_LONGITUDE $geoip_longitude;

fastcgi_param  REDIRECT_STATUS    200;
}
 
I'm finding this official add-on causes "The requested page could not be found." error when used with route filters.

I have a route filter of;
Screen Shot 2021-06-11 at 16.29.11.webp

With this add-on active, I get "The requested page could not be found." errors on multiple pages within the /blogs/ path. For example;
/blogs/blog/create
/blogs/add
/blogs/blog/

With this add-on disabled, no errors occur.

Is this an intention/consequence of this add-on to cause these errors with route filters, or a bug?
 
With this add-on active, I get "The requested page could not be found." errors on multiple pages within the /blogs/ path. For example;
/blogs/blog/create
/blogs/add
/blogs/blog/

I can confirm this behaviour. We eventually switched our route filters to /journals instead of /blogs which works. Would be great to hear from the developers. :)
 
It's mostly because that URL fits the format of what we potentially expect as a blog redirect. I don't think there would really be a workaround at this time short of code changes.
 
It's mostly because that URL fits the format of what we potentially expect as a blog redirect. I don't think there would really be a workaround at this time short of code changes.
I would be good if this add-on had option(s) to select/tick the applicable redirect (modules) to operate and/or it checked for XF route filters and didn't operate against those.
 
I would be good if this add-on had option(s) to select/tick the applicable redirect (modules) to operate and/or it checked for XF route filters and didn't operate against those.

I support this motion and hope the developers will consider implementing those options.
 
This add-on conflicts with adding a new route filter to XF called /blogs.

So I have an article forum called Blogs. I can enter it, but when l click to post a thread there's a page not found error. And I did not import any blogs. Thanks!

Using 1.1.5 since that's what was newest when I imported.
 
I didn't see people had the same issue above. What file can we edit to fix this? I don't need blog redirects, did not import them. Thanks!

PS. XF announced the article format could be used for blogs. So this should be considered. More people will encounter this.
 
Last edited:
Hello, trying to get this addon (XenForo Redirects for vBulletin 1.1.9) functional. I changed from VB3.8 with blogs and VBSEO to Xenforo 2.2x. VB3.8 and XenForo are in different directories, VB= /home/*****/public_html/forums and Xen = /home/*****/public_html/community (***** substituted for actual path.)
The addon supplied index.php and .htaccess have been placed in /home/*****/public_html/forums
Here are the files.
index.php =
Code:
<?php

// Enter the full path to your XenForo directory here:
$dir = '/home/*****/public_html/community';

require($dir . '/src/XF.php');

XF::start($dir);
XF::runApp('XF301VB\Pub\App');
and .htaccess =
Code:
#    Mod_security can interfere with uploading of content such as attachments. If you
#    cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#    SecFilterEngine Off
#    SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default

<IfModule mod_rewrite.c>
    RewriteEngine On

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>

I'm petty sure the .htaccess needs to be modified but I'm lost... Looking for help with this (I think.)

The forum, thread and post id's were not retained (unsure as to why.). The import log is set under setup>options>vBulletin import>vBulletin import log table to 'import_log_vbulletinwithblog_1.
optionselect.JPG

impdb.JPG

The table is showing the correct old and new forum, thread / post id's.

forumoldnewids.JPG
threadidchange.JPG
newpostiddb.JPG


This is the old VB thread url -->> https://www.jeep-cj.com/forums/f49/cj-spotted-thread-26688/
And the new XEN thread url -->> https://jeep-cj.com/community/threads/cj-spotted-thread.57395/
This is the old VB post url -->> ??? Not sure about this one
And the new XEN post url -->> https://jeep-cj.com/community/threads/cj-spotted-thread.57395/#post-514001
This is the old VB forum url -->> https://www.jeep-cj.com/forums/f49/
This is the new XEN forum url -->> https://jeep-cj.com/community/forums/misc-cj-discussion.119/

Any ideas?
Thanks... :)
 
I have this working with my site, but URL's that end in .html#post999999 they 404... Any ideas how to fix this on nginx?
 
Issue with redirections. Need help, please. Here are the details

Transferred from vBulletin V 3.8.11 with vbseo plugin enabled to XF 2.2.7

I ran all the steps mentioned and have import_log_vbulletin_1 table.
I'm running this on a local machine and have setup everything well including the AllowOverride ALL and Allow from all.
Also verified it is the same in httpd.conf file.

I have XF at newdomain.com/forums and the old one at olddomain.com/forums

I have copy-pasted the index and htaccess file in the old forum directory.

When I go to the old URL, it won't redirect me to new URL and would give an error "The requested page could not be found"

So, I tried a setup in such a way that my old and new forum URLs would remain the same i.e. at newdomain/forums

Still, it won't work and will give an error "Oops! We ran into some problems. The requested page could not be found."

The URL that I tried with the new setup is newdomain.com/forums/<forumname>/<thread-id>-name-of-thread.html

PS: I'm on Apache server

Any help will be appreciated. Thanks!
 
Top Bottom