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

XF 1.0 Problem redirecting vb4 mod-rewrite urls

Discussion in 'Installation, Upgrade, and Import Support' started by DRE, Oct 27, 2011.

  1. DRE

    DRE Well-Known Member

    I have vb4 mod-rewrite urls.
    My vbulletin forum is on my site root (so is wordpress).
    Ex. http://www.the8thlegion.com/forum.php
    My xenforo forum is on a folder on my site root called forum
    Ex. http://www.the8thlegion.com/forum
    I am also using an archived import log
    I entered the path of xenforo forum and nave of import log table in 301 file.

    I have done the following steps highlighted in green.

    Mod_Rewrite URLs:

    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/
    The URLs did not work at number 2. I have not changed my vbulletin .htaccess at all.

    When it says 'be sure to disable any remaining vb4 rewrite rules as they may interfere with the routes'

    Does that mean to delete the mod-rewrite rules in my vbulletin htaccess?
  2. DRE

    DRE Well-Known Member

    Xenforo .htaccess

    #    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
        #    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) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
        RewriteRule ^/threads/ /forum/threads
    RewriteRule ^/forums/ /forum/forums
  3. DRE

    DRE Well-Known Member

    vBulletin 4 .htaccess

    php_flag magic_quotes_gpc off
    AuthName "blahblah"
    AuthUserFile "blahblah"
    RewriteEngine On
    # Rewrite added for CloudflareInstall
    RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
    RewriteCond %{SERVER_PORT} ^80$
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
    #RULES for SEO translation links without any SEO engine (on raw vBulletin links)
    #If you are using vB 'Mod Rewrite Friendly URLs' then put those rules JUST BEFORE vB rules
    RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/archive/index.php/(.*)?$ archive/index.php?/$2&language=$1 [L,QSA]
    RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ index.php?language=$1 [L,QSA]
    RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ $2?language=$1 [QSA]
    # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
    # RewriteBase /forum/
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^threads/.* showthread.php [QSA]
    RewriteRule ^forums/.* forumdisplay.php [QSA]
    RewriteRule ^members/.* member.php [QSA]
    RewriteRule ^blogs/.* blog.php [QSA]
    ReWriteRule ^entries/.* entry.php [QSA]
    RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2 [QSA]
    RewriteRule ^content/(.*) content.php?r=$1 [QSA]
    RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1 [QSA]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    ## Charset
    AddDefaultCharset Off
    ## ETags
    FileETag None
    ## Expires
    <ifModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 1 seconds"
        ExpiresByType text/html "access plus 1 seconds"
        ExpiresByType image/gif "access plus 259200000 seconds"
        ExpiresByType image/jpeg "access plus 259200000 seconds"
        ExpiresByType image/png "access plus 259200000 seconds"
        ExpiresByType text/css "access plus 60480000 seconds"
        ExpiresByType text/javascript "access plus 21600000 seconds"
        ExpiresByType application/x-javascript "access plus 21600000 seconds"
    ## Compression
    <ifmodule mod_headers.c>
        <ifmodule mod_deflate.c>
            AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript
            BrowserMatch ^Mozilla/4 gzip-only-text/html
            BrowserMatch ^Mozilla/4\.0[678] no-gzip
            BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    ## Rewrites
    RewriteEngine on
    Options +FollowSymlinks
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    # Media Library
    ReWriteRule ^media/m(\d+).*/tags$ media.php?do=tags_edit&mid=$1
    ReWriteRule ^media/m(\d+).*/edit$ media.php?do=details_edit&mid=$1
    ReWriteRule ^media/m(\d+).*/report$ media.php?do=report&mid=$1
    ReWriteRule ^media/m(\d+).*/c(\d+)$ media.php?do=comment_edit&cmt=$2
    ReWriteRule ^media/m(\d+).* media.php?do=details&mid=$1
    ReWriteRule ^media/c(\d+).* media.php?do=category&cid=$1
    ReWriteRule ^media/u(\d+).* media.php?do=user&uid=$1
    ReWriteRule ^media/tag/(.*) media.php?do=tag&tid=$1
    ReWriteRule ^media/tagcloud.* media.php?do=tag_cloud
    ReWriteRule ^media/search/(.*) media.php?do=search&query=$1
    ReWriteRule ^media/letter/(.*) media.php?do=letter&query=$1
    ReWriteRule ^media/submit.* media.php?do=submit
    ReWriteRule ^media/random.* media.php?do=random
    ReWriteRule ^media/admin/(\w+).* media.php?do=admin_$1
    # Media Library from Video Directory
    RewriteCond %{QUERY_STRING} do=viewdetails&videoid=(\d+)
    RewriteRule ^video\.php$ media.php?do=details&mid=%1
    RewriteCond %{QUERY_STRING} viewcategory&categoryid=(\d+)
    RewriteRule ^video\.php$ media.php?do=category&cid=%1
    RewriteCond %{QUERY_STRING} viewuser&userid=(\d+)
    RewriteRule ^video\.php$ media.php?do=user&uid=%1
    RewriteCond %{QUERY_STRING} viewtag&tag=(.*)
    RewriteRule ^video\.php$ media.php?do=tag&tid=%1
    ReWriteRule ^video\.php$ media.php
    # Forum
    RewriteRule ^threads/.* showthread.php [QSA]
    RewriteRule ^forums/.* forumdisplay.php [QSA]
    RewriteRule ^members/.* member.php [QSA]
    RewriteRule ^blogs/.* blog.php [QSA]
    ReWriteRule ^entries/.* entry.php [QSA]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    # MVC
    RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
    RewriteEngine Off
    <IfModule mod_headers.c>
    <FilesMatch "\.(gif|jpg|png|css|swf)$">
      Header set Cache-Control "max-age=29030400"
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A604800
    ExpiresByType text/css A604800
    ExpiresByType image/gif A604800
    ExpiresByType image/png A604800
    ExpiresByType image/jpeg A604800
    ExpiresByType application/x-shockwave-flash A604800
    RewriteEngine On
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$
    vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^view_(.*).htm$ view.php?pg=$1
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
  4. DRE

    DRE Well-Known Member

    I didn't know the next beta was out. Looks like I might have to wait longer for help on this.

    Can someone give me an alternative solution in the meantime?
  5. DRE

    DRE Well-Known Member

    I've opened up a ticket with my host URLJET just now to see what they say or can do.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This one, right?


    You shouldn't need to install the addon. The old rewrite rules should still work since XenForo is installed at /forum which doesn't conflict with any routes in your old .htaccess file. But you will need to add those additional rules to redirect to the new directory:

    If it still doesn't work or you need help then I can take a look if you give me your FTP login.
  7. DRE

    DRE Well-Known Member

    Do the rewrites you posted go to my vbulletin htaccess?
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes. Add those redirects to the vBulletin htaccess file. Upload the redirect scripts (standard-basic-advanced/upload) to the XenForo directory. That should do it. I think. :eek:

    Or another option is to specify the new directory in the 301config.php file and then upload those redirect scripts to your vBulletin directory.
  9. DRE

    DRE Well-Known Member

    I want to eventually delete my vbulletin installation and database etc. Which one of those would be the best choice if I plan on deleting the vbulletin?

Share This Page