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

XF 1.2 Redirect vbseo attachments?

Discussion in 'Installation, Upgrade, and Import Support' started by Andre Daub, Sep 10, 2013.

  1. Andre Daub

    Andre Daub Member





    Ho can i redirect the vbulletin links to the new XF Attachements?
  2. Mike

    Mike XenForo Developer Staff Member

    Is that the same attachment? I'm guessing that the old attachment was 16620, though I'm not 100% positive. If so, there are no redirect scripts for attachments so it's not trivial (that would have to be written).
  3. Andre Daub

    Andre Daub Member

    Thank you. No it is not the same attachment. I have only the old Url and i have picked a random URL from the new Attachments Structure.
  4. rellek

    rellek Well-Known Member

    FYI: We managed it to work. Required this Rewrite:
    RewriteRule ^attachments/(.+)/([0-9]+)[d-](.+)$ attachment.php?attachmentid=$2 [L]
    and the redirection scripts in the root of the domain. 301config.php was adjusted to point to the new XF location (in /forum) and that made old attachment links work.

    Additionally, we had to insert
    $config['enableClickjackingProtection'] = false;
    into library/config.php so that Google Image Search works (more precisely: loading the associated page to a matched image).
  5. Mike

    Mike XenForo Developer Staff Member

    I stand corrected - there is a attachment redirect script!
    Jeremy and rellek like this.
  6. rellek

    rellek Well-Known Member

    Yeah, I was surprised too. Didn't have this in my first XF forum which was imported to XF 1.1. So it must have been added quite recently.
  7. BamaStangGuy

    BamaStangGuy Well-Known Member

    What about this url: http://www.v6mustang.com/vb/attachments/f7/72506d1121305572-dpfe-sensor-dpfe-sensor.jpg

    in Nginx?

    attachment.php resides in /vb/ folder.

    I have tried this but it doesn't work:

    rewrite ^/vb/attachments/(.+)/([0-9]+)[d-](.+)$ /vb/attachment.php?attachmentid=$2 last;
  8. BamaStangGuy

    BamaStangGuy Well-Known Member

    Tried this as well, with no luck:

    rewrite ^/vb/attachments/f([\d]+)/([0-9]+)[d-](.+)$ /vb/attachment.php?attachmentid=$2 last;
  9. BamaStangGuy

    BamaStangGuy Well-Known Member

    I got this to work with the following rewrite:

    rewrite ^/vb/attachments/[^/]+/([0-9]+)d.+$ /index.php?attachments/$1/ permanent;
    and by editing staticfiles.conf in nginx to remove the jpg extension.
  10. DRaver

    DRaver Active Member

    I need an NGINX rewrite for attachments.

  11. DRaver

    DRaver Active Member

  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    Try this:

            location ~* ^/attachments/[^/]+/[0-9]+d[0-9]+-[^\./]+\..*$ {
                    rewrite [^/]+/([0-9]+)d[0-9]+-[^\./]+\..*
    /attachments/$1/ last;

Share This Page