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

XF 1.1 Redirect htaccess mismatch for VBSEO

Discussion in 'Installation, Upgrade, and Import Support' started by MRaburn, Dec 1, 2011.

  1. MRaburn

    MRaburn Active Member

    Hey guys.

    Having me some fun issues here... :/

    I can't get any VBSEO thread URLs to get matched and then redirected. I have tried this on my remote server and my local copy.

    Code:
    <IfModule mod_rewrite.c>
            RewriteEngine On
           
            RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
            RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
           
    </IfModule>
    On my remote server I have the test install in /beta with a local htaccess file there with the code above along with the default XF stuff.

    I have Kier's redirect scripts in place. It's not the import database thing that people see... as on the remote server I have not done an import but on the local I have done an import and can redirect to all threads using showthread.php?t=xxxx and it redirects perfect. But the above htaccess code will not catch a match.

    My URLS from VBSEO were /88888-example-thread.html

    I can even change the match to redirect to www.nasa.gov and it won't redirect.

    Does anybody see anything strange in my rules? These are pulled direct from the script generator for VBSEO.

    Thanks for any insight... this is the last thing I have to figure out before the 4mil post move. ;)

    Mike
     
  2. MRaburn

    MRaburn Active Member

    Example of what I have tried with the rules above...

    RewriteRule [^/]+/([\d]+)-.+.html http://www.nasa.gov [NC,L]

    Now if that is in the root of my server, then I should be able to go to www.site.com/8888-test-me.html and it redirect to Nasa no? Because it does not.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. MRaburn

    MRaburn Active Member

    Thanks for your input. Currently this is a fresh directory with no old VB files or VBSEO files. This is an fresh directory with XF installed and the Kier VB redirect scripts. Im concerned at this point it might be a server setting (i do have access) but heaven knows where to start. All other Rewrite rules for WP, VB and others work fine.

    This rule right here should trigger a reaction and it does not.

    RewriteRule [^/]+/([\d]+)-.+.html http://www.nasa.gov [NC,L]

    if I make up any URL as /88888.test-me.html and it should redirect to Nasa.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The regex is wrong for that test URL. This is correct:

    Code:
    RewriteRule [^/]+/([\d]+)\..+\.html http://www.nasa.gov [NC,L]
    
    However, this still doesn't work for me. Try it on your server.

    The regex is correct. I tested it using RedirectMatch which works on my server:

    Code:
    RedirectMatch [^/]+/([\d]+)\..+\.html http://www.nasa.gov
    
    RedirectMatch may be another option for you.
     
  6. MRaburn

    MRaburn Active Member

    Thanks for your input. Neither of those worked for me... its funny though, I finally found something would work... :/

    If I add a folder to the URL call, then the redirect works perfect.

    localhost/8888-testme.html will not work.

    BUT

    localhost/dingy/8888-testme.html will work.

    My local install is at root, and my server is in a folder. I have not done the big import on that box yet so I cant get a true feeling of how this works.

    :/

    Mike
     
  7. MRaburn

    MRaburn Active Member

    Jake,

    Im sorry I had typed wrong their example of there, there is not a naming structure of name.name.html, it was the - that should be there.
     
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can specify the actual directory name rather than using a generic path:

    Code:
    RewriteRule /directory/([\d]+)-.+.html http://www.nasa.gov [NC,L]
    
    I can take a look if you give me FTP access to your server.
     
  9. MRaburn

    MRaburn Active Member

    Jake,

    That worked!? Basically I just removed the first part of the regex. [^/]+/

    Then from within that folder it worked. The original code I was using from the auto script for the VBSEO convert for some reason it must have thought/detected that my URLs had a folder then the variable URL..

    site.com/threads/8888-test.html but thats not the case, mine are in the folder root of the install.

    This should work for me now!

    So recap for anyone wanting to redirect your VBSEO threads and you have your custom URLS set to VB install root,
    example mysite.com/forums/8888-thread-title.html with forums being the root install (any name really) then the code you want is the following:

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

    Thanks Jake!!
     
  10. TheBigK

    TheBigK Well-Known Member

    Let me confirm: The vBSEO redirect rules generated by the addon available on XF and Kire's redirect script work absolutely fine on vB4+vBSEO.
     
  11. MRaburn

    MRaburn Active Member

    I cannot confirm as I did not have VB4 but I am told they do work. The problem here was the htaccess that I was using assumed a folder path like site.com/posts/555-name.html, our site was site.com/555-name.html so the code above is a fix for that situation.
     

Share This Page