• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Redirects for vBSEO'd URLs

SchmitzIT

Well-known member
You pretty much described what I did, mrb. I did upload the mod_rewrite part, but have it disabled at the moment as it did not seem to have any impact on my forum.
 

SchmitzIT

Well-known member
Got mine working, after Mike gave me the golden tip.

As it turns out the import log table did exist in my backup. I exported it from a restore, then imported it into my live db, and using the tip from http://xenforo.com/help/import-redirection/, I added the table to the 301redirect file, and that did it.

Thanks, Mike (and of course everyone else offering help). This seriously had me worried to the extent that I stayed up late last night trying to get it done. It's such a relief knowing everything worked out eventually :)
 
Got mine working, after Mike gave me the golden tip.

As it turns out the import log table did exist in my backup. I exported it from a restore, then imported it into my live db, and using the tip from http://xenforo.com/help/import-redirection/, I added the table to the 301redirect file, and that did it.

Thanks, Mike (and of course everyone else offering help). This seriously had me worried to the extent that I stayed up late last night trying to get it done. It's such a relief knowing everything worked out eventually :)
Good news, thanks for the tip
 

Brandon Sheley

Well-known member
Where do I put these in my htaccess?

This is what I have and it's not working.

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

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data|js|styles|install) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule t([\d]+)-([\d]+)/ showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule t([\d]+)/ showthread.php?t=$1 [NC,L]
    RewriteRule f([\d]+)-([\d]+)/ forumdisplay.php?f=$1&page=$2 [NC,L]
    RewriteRule f([\d]+)/ forumdisplay.php?f=$1 [NC,L]
</IfModule>
http://www.google.com/search?hl=&q=site:general-forums.com&sourceid=navclient-ff&rlz=1B3MOZA_enUS415US415&ie=UTF-8

Thanks for the help

Well I've tried placing this code in several spots in the htaccess file and nothing changes.

Code:
RewriteEngine on
RewriteRule t([\d]+)-([\d]+)/ showthread.php?t=$1&page=$2 [NC,L]
RewriteRule t([\d]+)/ showthread.php?t=$1 [NC,L]
RewriteRule f([\d]+)-([\d]+)/ forumdisplay.php?f=$1&page=$2 [NC,L]
RewriteRule f([\d]+)/ forumdisplay.php?f=$1 [NC,L]
I hope I can get this sorted soon :)
 

melbo

Well-known member
Will it make any difference if one plans to move from /forum/ in vB to the xenforo-esqe directory of /community/?
I'd like to stay away from /forum/forums/ but want to make certain the 301 redirects from Kier and the vBSEO htaccess rewrite rules will support this directory change.

Thanks
 

Ingenious

Well-known member
No, it shouldn't make any difference, the settings allow you to specify the folder where the new forum lives.

Also because you're changing from vBSEO, you actually get two different places where you can do the folder (or domain) swap, either in .htaccess where you direct the old vBSEO link to the standard vB link, or with the XenForo redirects themselves.

So...

1. Redirect forum/vBSEOlink -> forum/showthread.php in .htaccess
2. forum/showthread.php is actually the XenForo redirect script and will redirect to community/XenForo-link

or

1. Redirect forum/vBSEOlink -> community/showthread.php in .htaccess
2. community/showthread.php is actually the XenForo rediect script and will redirect to community/XenForo-link
 

Carlos

Well-known member
Well I've tried placing this code in several spots in the htaccess file and nothing changes.
Well, the instruction tells you to put it on near the top...And even I'm not sure if that'd work.

Anyhow, these are my results:
Code:
Source: Rewrites for uploaded XML file

Thread Paging
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
Thread
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
Forum Paging
    Unsupported url format.
Forum
    Unsupported url format.

Copy the rewrite rules given below to your .htaccess file in the same directory where you have placed showthread.php and forumdisplay.php files provided by Kier: Redirection Scripts for vBulletin 3.x. If you already have some rewrite rules in that .htaccess file, place these near the top.

RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
My .htaccess is a standard xenforo file:
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 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) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
But where do we put it? Here?
Code:
<------vBSEO URL's?------->
#    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) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
I'm going to stop here, and come back to this later. Right now, I'm working on importing vb4 files over to my new CODForums XF instance! WHEE! :)
 
Do you need to keep the contents of your VB4 folder and keep VBSEO running for this to work or can you remove it all off your server once your done?
 
Thanks Shadab for releasing this product.

I've managed to get threads redirecting correctly using a combination of this script and Kier's redirects. Since I am using the default URL rewriting structure for vBSEO (001 - without forum category IDs) I am going to manually 301 forum categories to their respective locations using the following rule in .htaccess:
Code:
Redirect 301 /forum/category-on-vb/ http://www.targeturl.com/forums/category-on-xf.9/
(This is on the assumption that your vB installation resided in /forum and you are moving XF to root. The above are made up URLs)

Member URLs is what I am struggling with. Am I correct in thinking that the script developed by Shadab do not work for vBSEO member URLs? And if so, does anyone have any thoughts on how one might achieve seamless member URL redirects using .htaccess or the rewrite rules already provided?

Thanks!
 
Ok, so after setting up the vbulletin 4 redirector, and uploading my url settings via your website, then using the code it gave me. Instead of my forums telling me the post does not exist, it DOES redirect, but not to the existing post. Only to the forumhome... What's up?

Heres the code:
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 500 default
 
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule [\d]+-[^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [\d]+-[^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    RewriteRule ([\d]+)-[^/]+/index([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
    RewriteRule ([\d]+)-[^/]+/ forumdisplay.php?f=$1 [NC,L]
 
    #    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 added
Code:
    RewriteEngine On
    RewriteRule [\d]+-[^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [\d]+-[^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    RewriteRule ([\d]+)-[^/]+/index([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
    RewriteRule ([\d]+)-[^/]+/ forumdisplay.php?f=$1 [NC,L]
which is what your website said to do.
 

Claudio

Well-known member
UPDATE:

I've uploaded the script at: http://tools.geekpoint.net/xfseo/, with the ability to upload your own XML backup file and have the tool generate rewrite/redirect rules for you (in case you are not using a preset). Let me know if you encounter any errors while using the rewrite rules or the script itself.

View attachment 4147

/ End Update
######################################################################

If you had installed vBSEO for your vBulletin forum and want to redirect all those rewritten links to the corresponding XenForo links, there's no single way to do that unfortunately. The rewrite codes all depend on what url formats you were using. vBSEO ships with 7 presets by default, for which the rewrite rules can be instantly generated.

Credits:
» Got the idea from Mike's post.

Links:
» http://www.vbseo.com/blogs/mert-goekceimam/how-uninstall-vbseo-238/
» http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/
» http://xenforo.com/community/threads/xenseo-vbseo.4505/
» http://tools.geekpoint.net/xfseo/
This script will allow me to uninstall vBseo and keep urls working on vbulletin?