Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
  • Register
Welcome to the Q&A for Question2Answer.

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

My host won't allow current URL structure for user profile pages, is there a setting I can change to fix this?

+2 votes

Note, I'm not talking about the URL structure for questions, which can be adjusted in the admin section. That works fine for me. I'm referring specifically to the URL structure for user profile pages  like ../user/Henry

Is there a way to change the user profile page URL structure to adapt to this? For that matter, is there a way to change where the user profile link links out to (which file/line controls this)?

Btw, I am using an external users table, not Q2A's native users table. I've already tried the same backup on another server that allows for the URL structure and it works fine, so I don't think it's a config issue.

 

Ah here's the solution:

I went into qa--external-users.php and changed this section from:

return '<A HREF="'.htmlspecialchars($relative_url_prefix.'user/'.urlencode($publicusername)).

'" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';
 
to
 
 
return '<A HREF="'.htmlspecialchars($relative_url_prefix.'?qa=user/'.urlencode($publicusername)).'" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';
asked Oct 18, 2010 in Q2A Core by Henry
edited Oct 18, 2010 by Henry

2 Answers

+1 vote
The options in the admin section will also affect the URL structure for users, so you should try one of the later options.
answered Oct 18, 2010 by gidgreen
That was the first thing I tried. Went through all the "OK" options (bottom 3 in my case). None fixed it. The link to the user profile is still ../user/Henry

edit: Also is there a way to change where the user profile link links out to (which file/line controls this)?

edit: I changed config from external users = true to false the URL structure does change for local users. So it looks like it may be the way I modified the external_users code. Somewhere in here... Will review $publicusername=$logged_in_user['publicusername'];
       
        return '<A HREF="'.htmlspecialchars($relative_url_prefix.'user/'.urlencode($publicusername)).
            '" CLASS="qa-user-link">'.htmlspecialchars($publicusername).'</A>';