• 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?

#1
vBulletin:

domain.tld/attachments/suche-verkaufe/16620d1313950457-adidas-f50-adizero-prime-sg-anodized-purple-infrared-electricity-sam_1172.jpg

XF:

domain.tld/forum/attachments/next-gen-adizero-jpg.22482/

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

Mike

XenForo developer
Staff member
#2
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).
 

rellek

Well-known member
#4
FYI: We managed it to work. Required this Rewrite:
Code:
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
PHP:
$config['enableClickjackingProtection'] = false;
into library/config.php so that Google Image Search works (more precisely: loading the associated page to a matched image).
 

rellek

Well-known member
#6
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.
 

Brent W

Well-known member
#7
FYI: We managed it to work. Required this Rewrite:
Code:
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
PHP:
$config['enableClickjackingProtection'] = false;
into library/config.php so that Google Image Search works (more precisely: loading the associated page to a matched image).
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:

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

Brent W

Well-known member
#8
Tried this as well, with no luck:

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

Brent W

Well-known member
#9
I got this to work with the following rewrite:

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

DRaver

Active member
#10
I need an NGINX rewrite for attachments.

Code:
From:
http://www.my-domain.de/attachments/alte-fotowettbewerbe-hunde/61955d1389003298-hund-jahre-2013-hund-mai.jpg

to
http://www.my-domain.de/attachments/hund-mai-jpg.61955/