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

XF 1.5 DBSEO vb3 redirect help needed please.

Discussion in 'Installation, Upgrade, and Import Support' started by viper357, Nov 14, 2015.

  1. viper357

    viper357 Active Member

    Hi everyone, I am currently on vb 3.8.5 and have DBSEO installed, I need some help with rewrites for htaccess I believe.

    This is what my current url's look like for threads:

    What do I need to add to my htaccess for the urls to rewrite? My Xenforo will be installed in a folder at /forums Thanks for the help. :)

    Also, will I need to leave the DBSEO stuff in the htaccess file? This is what is in there at the moment...

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^marineaquariumsa.com$ [NC]
    RewriteCond %{SERVER_PORT} ^80$
    RewriteRule ^(.*)$ http://www.marineaquariumsa.com/$1 [R=301,L]`
    RewriteEngine On
    # If you are having problem with "None Could Be Negotiated" errors in Apache, uncomment this to turn off MultiViews
    # Options -MultiViews
    RewriteCond %{REQUEST_URI} !(admincp/|dbseocp/|modcp/|cron|mobiquo|forumrunner|api\.php)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ dbseo.php [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(admincp|dbseocp|modcp|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ dbseo.php [L,QSA]
  2. viper357

    viper357 Active Member

    Can anyone help with this please?
  3. Tracy Perry

    Tracy Perry Well-Known Member

    @viper357, @Jake Bunce may be able to help you out here. He's pretty good with this type of stuff.
    viper357 likes this.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The old DBSEO rules can be removed.

    Add these rules to the top of the .htaccess file in your web root:

    RewriteEngine On
    RewriteRule ^[^/]+/([0-9]+)-[^\./]+\.html$ /forums/threads/$1/ [R=301,L]
    That will redirect the thread URLs.

    With redirects in the web root and XF in a subdirectory you might need to set the RewriteBase in XF's .htaccess file to avoid conflicts.
    Tracy Perry and viper357 like this.
  5. viper357

    viper357 Active Member

    Thank you very much Jake, appreciate that.
    I don't quite understand that. The rewrite rules go into my old .htaccess file in the root, what must I do to XF's .htaccess file?
  6. viper357

    viper357 Active Member

    Oh wait, do you mean this bit? Do I just need to change this?
    #  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
  7. viper357

    viper357 Active Member

    Ok, I've figured it out, thanks for the help Jake, much appreciated. :D
  8. viper357

    viper357 Active Member

    I've been on XF for just over 2 months now. How long should I leave the rewrite rules in place? Are they ok to stay there indefinitely or is there some kind of timeframe after which they should be removed?
  9. Brogan

    Brogan XenForo Moderator Staff Member

    It depends whether you want old links (Google, posted on other sites, etc.) to redirect or 404.

    Google can take a significant amount of time to reindex.
    Links posted on other sites will generally never be updated to the new URLs.
  10. viper357

    viper357 Active Member

    True, thanks, I'll just forget they are there for now. :)

Share This Page