Resource icon

Redirection Scripts for vBulletin 3.x 8.0

No permission to download
Any suggestions on the best way to migrate from vB to Xenforo on the same directory without losing data? We still need to do a test install first to customize the styling, etc. etc. and then import vB and put it in the same directory as the original.

Also will this redirect script work with the new version of XF? Thanks!

Ray
 
These scripts are basically designed if you're migrating but keeping the base install in the same location. (Putting them elsewhere requires additional configuration).

The should work with any version of XF.
 
Right, we want to keep the base install in the same location, but what's the best practice for installing it before migrating so as to stylize it up, add on things, etc. before it's imported and goes live in the same location? In other words we need to keep our vB install going while we customize our new XF install and import stuff. Thanks!
 
Install it in a different directory then you should be able to just rename things when ready (and update your "Board URL" option).
 
Getting this...

Code:
http://www.domain.com/forums/section-alpha/6360-title-wing-3.html#post1680064
http://www.domain.com/forums/threads/title-wing.6360/#post1680064  WRONG
http://www.domain.com/forums/threads/title-wing.6360/page-3#post-1680064 CORRECT



http://www.domain.com/forums/section-alpha/6360-title-wing-2.html
http://www.domain.com/forums/threads/title-wing.6360/ WRONG
http://www.domain.com/forums/threads/title-wing.6360/page-2 CORRECT

My current .htaccess is like this.

Code:
RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

#    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 500 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>

Please help.

I have Kiers files in place in the root directory.
 
@eagle eyes

Since your ids are the same you don't need to use the PHP redirect scripts. Just put this at the top of the .htaccess file in your /forums directory:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /forums/threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-.+\.html$ /forums/threads/$1/ [R=301,L]

That should do it.

And make sure XF is set to show the same number of messages per page as vB, otherwise the page redirects are not appropriate:

Admin CP -> Home -> Options -> Messages
 
@eagle eyes

Since your ids are the same you don't need to use the PHP redirect scripts. Just put this at the top of the .htaccess file in your /forums directory:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /forums/threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-.+\.html$ /forums/threads/$1/ [R=301,L]

That should do it.

And make sure XF is set to show the same number of messages per page as vB, otherwise the page redirects are not appropriate:

Admin CP -> Home -> Options -> Messages

The post url is not working.
#post3136402 needs a dash. So #post-3136402 would work...
Thread pages are working fine, thank you!

Code:
http://www.domain.com/forums/section-alpha/192002-this-is-thread-title-2.html#post3136402 vb
http://www.domain.com/forums/threads/this-is-thread-title.192002/page-2#post3136402 wrong
http://www.domain.com/forums/threads/this-is-thread-title.192002/page-2#post-3136402 correct

Also how can i redirect
Code:
http://www.domain.com/forums/section-alpha/
To its appropriate URL? Any hope for that? If manual, one by one, any example?
 
The post url is not working.
#post3136402 needs a dash. So #post-3136402 would work...
Thread pages are working fine, thank you!

Code:
http://www.domain.com/forums/section-alpha/192002-this-is-thread-title-2.html#post3136402 vb
http://www.domain.com/forums/threads/this-is-thread-title.192002/page-2#post3136402 wrong
http://www.domain.com/forums/threads/this-is-thread-title.192002/page-2#post-3136402 correct

Also how can i redirect
Code:
http://www.domain.com/forums/section-alpha/
To its appropriate URL? Any hope for that? If manual, one by one, any example?

Anchors (#post3136402) cannot be redirected.

I wouldn't bother with forum URLs. They have no content anyways. But if you want then you can do a manual redirect:

Code:
RewriteRule ^section-alpha/$ /forums/forums/section-alpha.5/ [R=301,L]
 
Anchors (#post3136402) cannot be redirected.

I wouldn't bother with forum URLs. They have no content anyways. But if you want then you can do a manual redirect:

Code:
RewriteRule ^section-alpha/$ /forums/forums/section-alpha.5/ [R=301,L]

Im thinking about moving xenforo to /
Please let me know what to change in htacesss. Also i want URLs to be non-www even if they have www they will be redirected to non-www ones.


RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /forums/threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-.+\.html$ /forums/threads/$1/ [R=301,L]
 
@eagle eyes

For XF in the web root you will need to delete (or rename) the /forums directory because it will conflict with XF. Then you can implement the redirects and "no www" by adding this to the top of XF's .htaccess file in the web root:

Rich (BB code):
RewriteEngine On

RewriteRule ^forums/[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /threads/$1/page-$2 [R=301,L]
RewriteRule ^forums/[^/]+/([0-9]+)-.+\.html$ /threads/$1/ [R=301,L]

RewriteCond %{HTTP_HOST} !^yoursite\.com$
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
 
@eagle eyes

For XF in the web root you will need to delete (or rename) the /forums directory because it will conflict with XF. Then you can implement the redirects and "no www" by adding this to the top of XF's .htaccess file in the web root:

Rich (BB code):
RewriteEngine On

RewriteRule ^forums/[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /threads/$1/page-$2 [R=301,L]
RewriteRule ^forums/[^/]+/([0-9]+)-.+\.html$ /threads/$1/ [R=301,L]

RewriteCond %{HTTP_HOST} !^yoursite\.com$
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]

I have a directory at /gallery
That one is not redirecting to non-www URL. Causing duplicates.

It has its own .htaccess containing.

Code:
RewriteEngine on
Options +FollowSymLinks

#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d

RewriteRule ^(.*)/p([0-9]+)-(.*)-cpage([0-9+]).html$ showphoto.php?photo=$2&cpage=$4 [L]
RewriteRule ^(.*)/p([0-9]+)-(.*).html$ showphoto.php?photo=$2 [L]
RewriteRule ^(.*)/p([0-9]+).html$ showphoto.php?photo=$2 [L]

RewriteRule ^g([0-9]+)-(.*)-page([0-9]+).html$ showgallery.php?cat=$1&page=$3 [L]
RewriteRule ^g([0-9]+)-(.*).html$ showgallery.php?cat=$1 [L]

RewriteRule ^(.*)/index([0-9]+)-([0-9]+).html$ index.php?cat=$2&page=$3 [L]
RewriteRule ^(.*)/index([0-9]+).html$ index.php?cat=$2 [L]

RewriteRule ^m([0-9]+)-(.*)-protype([0-9]+).html$ member.php?uid=$1&protype=$3 [L]
RewriteRule ^m([0-9]+)-(.*).html$ member.php?uid=$1 [L]

RewriteRule ^board.html$ board.php [L]
RewriteRule ^b([0-9]+)-(.*).html$ board.php?msg=$1 [L]

RewriteRule ^u([0-9]+)-(.*)-cat([0-9]+).html$ showgallery.php?ppuser=$1&cat=$3 [L]
RewriteRule ^u([0-9]+)-(.*)-cat([0-9]+)-page([0-9]+).html$ showgallery.php?ppuser=$1&cat=$3&page=$4 [L]
RewriteRule ^u([0-9]+)-(.*)-page([0-9]+).html$ showgallery.php?ppuser=$1&page=$3 [L]
RewriteRule ^u([0-9]+)-(.*).html$ showgallery.php?ppuser=$1 [L]

RewriteRule ^s([0-9]+)-(.*)-page([0-9]+).html$ showmembers.php?cat=$1&page=$3 [L]
RewriteRule ^s([0-9]+)-(.*).html$ showmembers.php?cat=$1 [L]

I want it to also go to a non-www URL.
 
@eagle eyes

Add to top of .htaccess file inside of /gallery:

Rich (BB code):
RewriteEngine On

RewriteCond %{HTTP_HOST} !^yoursite\.com$
RewriteRule ^(.*)$ http://yoursite.com/gallery/$1 [R=301,L]
 
Top Bottom