XenForo Redirects for vBulletin

XenForo Redirects for vBulletin 1.1.7

No permission to download

Mr. Jinx

Well-known member
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.
 

Mr. Jinx

Well-known member
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.
 

ivp

Active member
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.
 

Mr. Jinx

Well-known member
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;
}
 

Mouth

Well-known member
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.png

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?
 

thomas1

Active member
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. :)
 

Mike

XenForo developer
Staff member
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.
 

Mouth

Well-known member
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.
 

thomas1

Active member
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.
 
Top