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

vBulletin 4.x URL Redirection 1.0.0

Adds support for the new URL structures in vB4 to the vB3 redirection scripts

  1. Luke F

    Luke F Well-Known Member

  2. polle

    polle Active Member

    Is there a way to include archive ?

    Everything is working fine except that, so I am looking a way to include archive and send it to the original thread itself.

    Posible ?
     
    zagman76 likes this.
  3. Calamity James

    Calamity James Active Member

    As the old thread got closed I'll repost my question:

    I'm having exactly the same problem as Gene, did anyone manage to figure out why? (I can see his now redirects correctly)

    ----

    Gene informs me that someone on here fixed it, does anybody know what that 'fix' is? I've tried all the suggestions in the previous thread to no avail!

    Thanks,
    James.
     
  4. Joshua

    Joshua Active Member

    I followed all directions here and on the import archive page and I am still having trouble with vb4.x redirects. My site was using Basic Rewrites in vB... any tips?

    edit: it appears to be the redirects that are causing the problems... The following works for me:
    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteOptions MaxRedirects=10
     
    Redirect 301 /forum/showthread.php http://www.mysite.com/xenforo/showthread.php
    Redirect 301 /forum/forumdisplay.php http://www.mysite.com/xenforo/forumdisplay.php
    
    The recommended rules do not work for me:

    Code:
    RewriteRule ^/forum/showthread.php /xenforo/showthread.php
    RewriteRule ^/forum/forumdisplay.php /xenforo/forumdisplay.php
    Is there any issue with using what I have above?
     
    StonePilot likes this.
  5. ARSamo

    ARSamo Member

    in my site case following links of my site from google were not redirected, however i applied all the instructions above..

    http://www.mydomain.com/showthr...ويئر-چونڊيو-۽-هڪ-ئي-ڪلڪ-سان-انسٽال-ڪري-وٺو۔۔۔

    http://mydomain.com/showthread.php?15623-فولڊرز-کي-پنهنجي-پسند-جا-رنگ-ڏيو&p=94445

    Thanks to Jack Bunce, who recommended following rules..

    Code:
        RewriteCond %{QUERY_STRING} (\?|^)([0-9]+)-.*
        RewriteRule showthread.php http://www.mydomain.com/showthread.php?t=%2 [R=301,L]
     
  6. demonkey

    demonkey Member

    EDIT this is now fixed for me.

    Below RewriteEngine On (in /.htaccess):
    Code:
    RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-([a-zA-Z0-9_\-]+)
    RewriteRule ^forums/showthread.php /showthread.php?t=%2 [R=301,L]
    
    Also notice mine is spelled /forums not /forum like yours ;)
    ---------------------------
    Old post:

    Joshua,
    I'm having troubles with this as well.

    My VB4 forum was in /forums and Xenforo is now in /

    If I load mysite.com/showthread.php?t=4 it works fine.
    If I load mysite.com/forums/showthread.php?t=4 it does not forward propertly (shows the 404 Xen foro error).

    mod_rewrite URLS e.g showthread.php?4-hello-world work fine as well, but not /forums/showthread.php

    I tried this in the root folder .htaccess, inside the <IfModule mod_rewrite.c> loop.
    Code:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-([a-zA-Z0-9_\-]+)
    RewriteRule /home/my-user-name/my-domain/forums/showthread\.php /showthread.php?t=%2 [R=301,L]
    
    I also tried a number of other configurations, including outside that loop like:
    Code:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-([a-zA-Z0-9_\-]+)
    RewriteRule forums/showthread\.php /showthread.php?t=%2 [R=301,L]
    
    No luck yet. I was thinking since XF redirects /forums to my root, this might be the problem. But I can't make this redirect work still.

    I also tried changing the second part of that regular expression (the output) to include the full domain path. I think I just suck at this. :(
     
  7. polle

    polle Active Member

    Anyone ?
     
    zagman76 likes this.
  8. zagman76

    zagman76 Member

    I would also be interested in this!
     
  9. zagman76

    zagman76 Member

    MikesSite and smimosmile like this.
  10. OakleyForum

    OakleyForum Active Member

    I transferred from vbulletin w/ vbseo and I setup redirects and used the VB4 redirect software which worked great. However I noticed that for some links, it redirects and adds my forum path.

    For example: in this thread below:
    When it redirects it sends it to
    Instead of
    Why is it adding in my server path??
    Other links redirect fine, but this does worry me!

    For reference, here is my htaccess file
     
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use a full web path for the targets.

    This:

    Code:
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [R=301,NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    RewriteRule f([\d]+)/index([\d]+).html forumdisplay.php?f=$1&page=$2 [R=301,NC,L]
    RewriteRule f([\d]+)/ forumdisplay.php?f=$1 [NC,L]
    
    Becomes this:

    Code:
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html /showthread.php?t=$1&page=$2 [R=301,NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html /showthread.php?t=$1 [NC,L]
    RewriteRule f([\d]+)/index([\d]+).html /forumdisplay.php?f=$1&page=$2 [R=301,NC,L]
    RewriteRule f([\d]+)/ /forumdisplay.php?f=$1 [NC,L]
    
    I added a / in front of showthread.php and forumdisplay.php. That assumes those files are in the web root. If they are in a subdirectory then add that.
     
  12. OakleyForum

    OakleyForum Active Member

    It fixed it! Thanks a MILLION!!!!!!
     
  13. BamaStangGuy

    BamaStangGuy Well-Known Member

    I must be doing something wrong. I am using the vbulletin mod_rewrite url redirect for vBulletin. I have done the conversion and followed the instructions but all old vBulletin urls do not redirect correctly.

    Take this url for example: http://www.politicaljack.com/threads/37087-Ashoken-Farewell‎

    That just redirects back to the main forum page.

    Here is my .htaccess:

    Code:
    #    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
    #</IfModule>
     
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
     
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^politicaljack\.com [NC]
        RewriteRule (.*) http://www.politicaljack.com/$1 [L,R=301]
     
     
        #    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]
    </IfModule>
    AuthName "xenForo Test Bed"
    AuthUserFile "/home/politics/.htpasswds/public_html/xenforo/passwd"
    
     
  14. BamaStangGuy

    BamaStangGuy Well-Known Member

    Anyone? I have 50k urls I need redirected.
     
  15. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  16. BamaStangGuy

    BamaStangGuy Well-Known Member

  17. BamaStangGuy

    BamaStangGuy Well-Known Member

    This is the 301 config file:

    Code:
    <?php
    
    /* ----------------------------------------------------------- *\
    This variable defines where XenForo is installed.
    If you have not installed XenForo into the same directory in which
    vBulletin was installed, you will need to provide the full path to
    the XenForo directory here. Remove the leading // and then enter
    the path as in the following examples:
        $fileDir = '/home/example/public_html/new_forums';
        $fileDir = 'C:/inetpub/wwwroot/xenforo';
    \* ----------------------------------------------------------- */
        $fileDir = '/home/politics/www';
    /* ----------------------------------------------------------- *\
    This constant defines the table from which the import redirection
    scripts will fetch their data. Normally they will use the table
    'xf_import_log', but if you have archived your import data, you
    should provide the name of the archive table here. Remove the
    leading // and then replace 'import_log_x' with the name of your
    archive table, as in the following examples:
        define('IMPORT_LOG_TABLE', 'my_import_log');
        define('IMPORT_LOG_TABLE', 'import_log_my_forums');
    \* ----------------------------------------------------------- */
        define('IMPORT_LOG_TABLE', 'archived_import_log');
    I double checked and everything appears correct here.
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    @BamaStangGuy

    The ids are the same so the redirect scripts aren't necessary. Just add this code to your .htaccess file:

    Code:
    #    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
    #</IfModule>
     
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
     
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^politicaljack\.com [NC]
        RewriteRule (.*) http://www.politicaljack.com/$1 [L,R=301]
     
        RewriteRule ^threads/([0-9]+)-.*$ /threads/$1? [R=301,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]
    </IfModule>
    AuthName "xenForo Test Bed"
    AuthUserFile "/home/politics/.htpasswds/public_html/xenforo/passwd"
    
     
    RoldanLT and Breixo like this.
  19. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  20. BamaStangGuy

    BamaStangGuy Well-Known Member

Share This Page