XF 2.1 Cannot change avatars - clicking existing avatar gives a 404 error

Overscan

Active member
On my forum, no-one can edit their avatars in the forum.

If you click on the existing avatar, it says "oops. We ran into some problems". Using Chrome developer tools I can see 404 error for URL:


Code:
 https://www.secretprojects.co.uk/account/avatar?_xfRequestUri=%2Faccount%2F&_xfWithData=1&_xfToken=1559808904%2C04f76f710609d3cb70a484c2f74bae89&_xfResponseType=json

I note that

Code:
https://xenforo.com/community/account/avatar

works and gives the avatar editing page

On my forum

Code:
https://www.secretprojects.co.uk/account/avatar

Gives a 404 error.

I don't really understand how this URL relates to scripts in Xenforo, so not sure what is wrong. Maybe nginx config?
 
Last edited:

tonmo

Well-known member
Just to follow up, I had this very problematic line in my ssl.conf file on my nginx server... removed it, and this problem is solved. I'm not sure why I had included that line in the first place (some stack overflow search I imagine, related to how index.php is handled) -- but removing it has caused no issues.

Commented out this line in the ssl conf file:

Code:
 # if ($request_uri ~* "^(.*/)index\.php(.*)") { return 301 $1$2; }
 

bolef2k

Member
Took me quite a while to figure out but there is a way easier way to fix this!

In the member_view template, go to the line 29...
<xf:avatar user="{$user}" size="l" href="" update="{{ link('account/avatar', $user) }}" />
Change to:
<xf:avatar user="{$user}" size="l" href="" update="{{ link('account/avatar/', $user) }}" />

And same goes for the account_avatar template on line 8
Change to
<xf:form action="{{ link('account/avatar/') }}" upload="true" ajax="true" class="block" data-xf-init="avatar-upload">

Fixes my issue finally
 
Top