1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 old URLs redirect issue

Discussion in 'Installation, Upgrade, and Import Support' started by Kimiko, Jan 2, 2012.

  1. Kimiko

    Kimiko Member

    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:

    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!
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
    Kimiko likes this.
  3. Kimiko

    Kimiko Member

    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.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
  5. Kimiko

    Kimiko Member

    Something is horribly wrong with the add-on creator's first post then :unsure:
    I see this description of it:
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

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

    Kimiko Member

    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.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:

    #	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
    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]
    That should redirect only the vB4 format of "members" links.

    And here is the modified code for the redirect script:

    Kimiko likes this.
  9. Kimiko

    Kimiko Member

    That got it working, thanks a lot!
    I can finally move on to the less stressful parts of migrating thanks to this.

Share This Page