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
 
Thanks for this resource. It works great. Question

I had my original phpbb3 forum installed in a subdirectory. I now installed Xenforo in the domain root. Is it possible to adapt these .htaccess rules and place them in the root .htaccess instead of the old subdirectory .htaccess file? I tried a few things but can't figure out how to modify the rules above. I'd ultimately just like to eliminate the old subdirectory folder which is why I'm trying to place these rules in the root.

OLD PHPBB3 domain.com/forum/
NEW XENFORO domain.com

Thanks in advance. If there are any clarification questions needed, please let me know.
 
Back
Top Bottom