XF 1.4 Please help with URL Redirects

Amin Sabet

Well-known member
I am doing my first vB4 to XF import. Quite exhilirating!

These are my current .htaccess contents which contain the rewrites I put in place after uninstalling vBSEO last year:

Code:
## Forward non-www to www
RewriteCond %{HTTP_HOST} ^talkemount.com
RewriteRule (.*) http://www.talkemount.com/$1 [R=301,L]

## Forward vBSEO to non-vBSEO URLs after uninstalling vBSEO
RewriteRule [^/]+/[^/]+-([0-9]+)/ http://www.talkemount.com/showthread.php?t=$1 [L,R=301]
RewriteRule ^f([0-9]+)/$ http://www.talkemount.com/forumdisplay.php?f=$1 [L,R=301]
RewriteRule ^members/(.+)/ http://www.talkemount.com/member.php?username=$1 [L,R=301]


Can someone please tell me how to change these as needed to redirect to my new Xenforo URLs?
 
I've got my redirects working okay from my old vB URLs to the new XF ones, but the old old vBSEO URLs indexed in Google aren't redirecting to the new XF ones.
 
Unfortunately not working for me, but that's okay. Google already 98% switched over from my old vBSEO URLs to my vB4 URLs, and the latter are getting properly redirected to my new XF URLs.
 
I'd like to try again at this since Webmaster Tools is reporting a lot of crawl errors.

The site Mike mentioned gave me the rules below, which I am using in htaccess along with the standard-basic-advanced files posted by Luke here and the 301config.php file with archived import log as mentioned here.

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

The great majority of my indexed pages are in this vBulletin format:

http://www.mu-43.com/showthread.php?t=48933

and those are redirecting properly to my current URL:

http://www.mu-43.com/threads/48933/

but Google still has some indexed in this vBSEO version:

http://www.mu-43.com/f56/roosevelt-island-ode-weather-sealing-warning-lots-big-pictures-48933

and those get redirected to the forum without going to the specific thread.

The odd thing is that some of those vBSEO URLs are being redirected fine. Like this one:

http://www.mu-43.com/f38/using-filters-7-14mm-problem-solved-28762/

gets properly redirected to here:

http://www.mu-43.com/threads/28762/

If I add a trailing slash to this:

http://www.mu-43.com/f56/roosevelt-island-ode-weather-sealing-warning-lots-big-pictures-48933

then it works. But others indexed have a trailing slash and don't work. Like this one:

http://www.mu-43.com/f40/adapted-lens-image-thread-302-post301372/

Any help greatly appreciated.
 
You don't have a rule that would match the thread URL without the trailing slash. You're either matching with index#.html or with a trailing slash.

A modified version of your second rule would probably work:
Code:
RewriteRule f[\d]+/.+-([\d]+)(/|$) showthread.php?t=$1 [NC,L]

Your last example appears to be a post-specific format, so it won't match any of your existing rules. This may work:

Code:
RewriteRule f[\d]+/.+-post([\d]+)(/|$) showpost.php?p=$1 [NC,L]
 
Hi Mike, thanks for supporting with me on this. I added those two rules, and they don't seem to have made any difference. Was I supposed to remove any of the other rules?
 
Where did you add them? Rules are processed top down and as soon as one matches, it stops. Because of the URL structure, your last rule ends up being a catch all.

Note that the first rule I posted was a modification of your second rule so it would replace it. The post rule can probably go first.

Also, when testing rule changes, be aware of browser caching. You may need to try in an incognito window or a different browser to confirm whether changes have been applied.
 
Top Bottom