Resource icon

Redirection Script for phpBB 3.2/3.3+ (without SEO URLs) htaccess 1.0

No permission to download

Vroomm

Active member
STNN submitted a new resource:

Redirection Script for phpBB 3.2/3.3+ (without SEO URLs) htaccess - Htaccess script for redirecting phpbb3 urls to xenforo

This script is based on different htaccess rules posted on xenforo forums and my own editing.

Requirements:

This script assumes you have friendly urls enabled for Xenforo.

What it will do

"/viewforum.php?f=X" will redirect to "/forums/X/" and
"/viewtopic.php?t=X" will redirect to "/threads/X/" and
"/viewtopic.php?p=X" will redirect to "/posts/X/".
"/memberlist.php?mode=viewprofile&u=X" will redirect to "/members/X/".

If...

Read more about this resource...
 
I'm still trying to get this converted to NGINX using CentminMod from @eva2000 setup. Do I place these items into the already location / where I have my XenForo SEO urls at?
NGINX:
 if ($query_string ~* "(^|&)t=([0-9]+)(&|$)"){
    rewrite ^/viewtopic\.php$ /threads/%2/? redirect;
  }
  if ($query_string ~* "f=(\d+)$"){
    rewrite ^/(viewforum\.php|viewtopic\.php)$ /forums/%1/? redirect;
  }
  if ($query_string ~* "(^|&)p=([0-9]+)(&|$)"){
    rewrite ^/viewtopic\.php$ /posts/%2/? redirect;
  }
  if ($query_string ~* "u=(\d+)$"){
    rewrite ^/memberlist\.php$ /members/%1/? redirect;
  }

Example of this code would be:

NGINX:
location / {
  index index.php index.html index.htm;
  try_files $uri $uri/ /index.php?$uri&$args;
  include /usr/local/nginx/conf/503include-only.conf;

 if ($query_string ~* "(^|&)t=([0-9]+)(&|$)"){
    rewrite ^/viewtopic\.php$ /threads/%2/? redirect;
  }
  if ($query_string ~* "f=(\d+)$"){
    rewrite ^/(viewforum\.php|viewtopic\.php)$ /forums/%1/? redirect;
  }
  if ($query_string ~* "(^|&)p=([0-9]+)(&|$)"){
    rewrite ^/viewtopic\.php$ /posts/%2/? redirect;
  }
  if ($query_string ~* "u=(\d+)$"){
    rewrite ^/memberlist\.php$ /members/%1/? redirect;
  }

  }

Not sure if @Jake Bunce can be of assistance here or not.
 
This code links to the thread but does not link to the correct post

in this thread

For example:



The link to different posts but the result is the same
 
Top Bottom