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

XF 1.2 Disabling Friendly URLs for Member Profiles

Warchamp7

Active member
#1
As I understand it, having AdSense ads on profile pages where the username is in the URL is against policy, so I'd like to know the ideal way to make it so profile pages don't take advantage of the Friendly URL functionality and only contain the user ID
 

Brogan

XenForo moderator
Staff member
#2
That's not what friendly URLs does - that removes the index.php from the URL.

What you are referring to is the 'Include Content Title in URLs' option.
It's all or nothing though, it can't be disabled just for members.
 
#5
That is the last-resort solution. Would prefer not to see a reduction in revenue if the issue is solvable through other means. Any other ideas out there?
 
Last edited:

Jim Boy

Well-known member
#6
I'm not sure about code in 1.2, I have 1.3, but in Link.php changing the line
Code:
return "$prefix/" . self::buildIntegerAndTitleUrlComponent($data[$intField], $title) . "/$action$extension";
to be
Code:
  if($prefix=="members")return "$prefix/" . $data[$intField] . "/$action$extension";
  else return "$prefix/" . self::buildIntegerAndTitleUrlComponent($data[$intField], $title) . "/$action$extension";
will do the job.

BIG WARNING - this involves changing core XenForo code and is strongly advised against. Really an add-on should be developed to do this. I'll probably do one, but a couple of pointers in terms of what listeners to be looking out for would be handy.