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

XF 1.2 vBSEO to XenForo friendly urls

Discussion in 'Installation, Upgrade, and Import Support' started by Fred., Nov 26, 2013.

  1. Fred.

    Fred. Well-Known Member


    I'm trying to figure out how to rewrite my vBSEO urls to XenForo friendly urls.

    All the ID's are still the same, and all the old and new id's are in archived_import_log

    I have Kier his redirect scripts (V6) in the main directory were XenForo is located

    In 301config.php i changed the location to XenForo and archived_import_log.

    in .htaccess i have

    # vBSEO to XF
    # RewriteEngine on
    # RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    # RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    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|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    But i keep getting
    XenForo - Error
    The requested page could not be found.

    I probably do something wrong. But i have no idea what's wrong...
    Can anyone help me?

  2. Mike

    Mike XenForo Developer Staff Member

    You have what are presumably the correct rewrites at the top of the file, but they're commented out. Is there a particular reason for that?
  3. Fred.

    Fred. Well-Known Member

    That's just information Mike.
    The same rules are on the bottom between the IfModule tags.

    Or do i have to keep them out the IfModule tags?
  4. Mike

    Mike XenForo Developer Staff Member

    You have to have them before the fallback rule, so uncomment the ones at the top.
    Adam Howard likes this.
  5. Brent W

    Brent W Well-Known Member

    Try putting the redirect lines right after the RewriteEngine On line
  6. Fred.

    Fred. Well-Known Member

    Thanks guys!
    Problem solved :D

    The only thing is that i have 2 times rewrite engine on now. One on top outside the IfModule tags and one inside.
    Is that ok? Or do i need to remove one of them?
  7. Mike

    Mike XenForo Developer Staff Member

    Nothing to worry about.
    Adam Howard and Fred. like this.

Share This Page