XF 1.1 old URLs redirect issue

Kimiko

Member
Hi,
I just did a test import on a local machine. I modified the windows hosts file to point my domain to the LAN IP so I can properly test it using the real domain name.

I'm having a lot of trouble to get my old URLs from VB4 to redirect to the new URL format.
Using the following add on: http://xenforo.com/community/threads/vbulletin-4-x-url-redirection.7584/

I am using the vbulletin built in "mod rewrite" method on my original forum, so these are the steps I followed:

  1. Upload contents of standard-basic-advanced/upload folder to your forum root.
  2. If your old rewrite rules are still in place, your URLs may work at this stage. If not, continue to install a route-based alternative: (and be sure to disable any remaining vB4 rewrite rules as they may interfere with the routes)
  3. Upload contents of mod_rewrite/upload folder to your forum root.
  4. Install the addon XML file mod_rewrite/addon_vB4Redir.xml
  5. If your URLs are not working, follow these instructions: http://xenforo.com/help/import-redirection/

I have check to make sure and the ID of threads and post and user ID matches perfectly the same as vbulletin ones in the old forum.


Here is my setup:

forum installed in: domain.com/
vb friendly urls: mod rewrite
XF friendly urls: "Use Full Friendly URLs" and "Include Content Title in URLs"
.htaccess: default one that come with xenforo as htaccess.txt

The problem:
All the links from the vbulletin link structure (such as those found in google searches) redirect me to the home page of the forum.

Please help me to resolve this issue. The only reason I decided to buy xenforo is because I was told redirecting from vbulletin is no problem... but I have spent all day trying to make this work.

Thank you!
 
I have setup those vB4 redirects before. Make sure the xf_import_log table contains the id mappings. If the mappings are in archived_import_log then you need to swap the table names. That vB4 redirect addon doesn't have an option to specify a log table other than the default.

If you continue to have problems then I can take a look if you are comfortable giving me access to your server and forum.
 
I have setup those vB4 redirects before. Make sure the xf_import_log table contains the id mappings. If the mappings are in archived_import_log then you need to swap the table names. That vB4 redirect addon doesn't have an option to specify a log table other than the default.

If you continue to have problems then I can take a look if you are comfortable giving me access to your server and forum.
Thanks! That fixed it for forums and threads.
So simple yet I didn't see it mentioned in the thread for that add-on.
The URLs for members are still not working so I'll see with the add-on creator what might be going on.
 
The URLs for members are still not working so I'll see with the add-on creator what might be going on.

That mod_rewrite addon only does forums and threads, unlike the standard-basic-advanced redirects which do more. You would have to make your own redirects for mod_rewrite member URLs. For most forums the thread redirects are the most important thing as they contain almost all of the content.
 
That mod_rewrite addon only does forums and threads, unlike the standard-basic-advanced redirects which do more. You would have to make your own redirects for mod_rewrite member URLs. For most forums the thread redirects are the most important thing as they contain almost all of the content.


Something is horribly wrong with the add-on creator's first post then :unsure:
I see this description of it:
StuCW.png
 
It is possible to modify the standard-basic-advanced scripts to handle mod_rewrite members. I did this for some one a while ago. I am trying to find the code I used...

These mod_rewrite URLs are a pain because of conflicting routes.
 
It is possible to modify the standard-basic-advanced scripts to handle mod_rewrite members. I did this for some one a while ago. I am trying to find the code I used...

These mod_rewrite URLs are a pain because of conflicting routes.
Yeah I tried to do one myself for members, but since both use "/members/" I have no clue what to do. I'll try some more tomorrow after work but I'm no good with regular expressions or mod rewrite in general.
 
I found the conversation where I posted the code. But it depends on vB4's htaccess file. He was able to get away with this because XF was installed in a different directory, so vB4's htaccess could remain in place in the old directory. Is your XF forum in the same location or a different location than vB? If it's in the same directory then you will need to add some custom rewrites to your XF htaccess file to handle a special format of "members" links. Something like:

Rich (BB 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 ^members/([0-9]+)-([a-z0-9\-]+)$ member.php [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>

That should redirect only the vB4 format of "members" links.

And here is the modified code for the redirect script:

Jake Bunce said:
member.php original:

Code:
if(preg_match('/member\.php(?:\/|\?)([0-9]+)/', $http->getRequestUri(), $matches) && count($matches) >= 1){    
	$input['u'] = intval($matches[1]);
}

modified:

Code:
if(preg_match('/(member\.php|members)(?:\/|\?)([0-9]+)/', $http->getRequestUri(), $matches) && count($matches) >= 1){    
	$input['u'] = intval($matches[2]);
}
 
Top Bottom