Add-on Vanity URLs for Member Page Based On Special Usergroup

Honestly, I think that the only problem with user's remembering their page is the userid issue.

Currently our pages are xenforo.com/community/members/dre.xxxx

If it was xenforo.com/community/members/dre then that's way easier to remember and would be an easier addon to develop.

I would then just use the default route changer in Xenforo 2.1 to turn 'members' into 'go'.

It would then be xenforo.com/community/go/dre which is shorter and easier remember.

Because my forum is on the root, it would be forumname.com/go/dre

Waaay easier to remember and probably less complicated to develop.
 
I just changed the name of my 'members' page to 'go' with the route filter and I'm liking it already.
 
I'm going to try to make an addon to do this.

Most likely it'll have the following options:

http://forum.com/members/Jake-B.38615 (default profile link if you don't have a vanity url chosen)

http://vanity.forum.com
http://forum.com/members/vanity

The vanity field will allow the following characters:

A-Z, a-z, 0-9, and a maximum of one hyphen.
The main reason I think forum.com/members/username is easier is due to the current problems that Better Blogs has with vanity urls. With Better Blogs, when you're at vanity.forum.com and you click on another link such as the forum list, instead of going to forum.com/board it will make you go to vanity.forum.com/board and that causes cookie issues because when you go to vanity.forum.com/board you have to login again.
 
The main reason I think forum.com/members/username is easier is due to the current problems that Better Blogs has with vanity urls. With Better Blogs, when you're at vanity.forum.com and you click on another link such as the forum list, instead of going to forum.com/board it will make you go to vanity.forum.com/board and that causes cookie issues because when you go to vanity.forum.com/board you have to login again.

Those problems are fairly easy to fix. In library/config.php you can add
Code:
$config['cookie'] = array(
    'prefix' => 'xf_',
    'path' => '/',
    'domain' => '.yoursite.com'
);
and your cookies will work on all subdomains
 
  • Like
Reactions: DRE
Those problems are fairly easy to fix. In library/config.php you can add
Code:
$config['cookie'] = array(
    'prefix' => 'xf_',
    'path' => '/',
    'domain' => '.yoursite.com'
);
and your cookies will work on all subdomains
I turned Better Blogs Multisite back on to experiment.

I tried

Code:
$config['cookie'] = array(
    'prefix' => 'xf_',
    'path' => '/',
    'domain' => '.yoursite.com'
);

and got this error:

Parse error: syntax error, unexpected '.8' (T_DNUMBER), expecting ')' in /home/blah/public_html/library/config.php on line 26

My Better Blogs config settings for Multisite looks like this:

Code:
//Configuration for Blog MultiSite
$config['blog']['multisite'] = true;
$config['cookie']['domain'] = '.8th.us';

I tried that config setting along with that. Same error. I tried it with just that setting, still didn't work.

Thanks anyway. I turned Better Blogs multisite off. I'd rather just try to get a members page vanity url addon instead.
 
I turned Better Blogs Multisite back on to experiment.

I tried

Code:
$config['cookie'] = array(
    'prefix' => 'xf_',
    'path' => '/',
    'domain' => '.yoursite.com'
);

and got this error:

Parse error: syntax error, unexpected '.8' (T_DNUMBER), expecting ')' in /home/blah/public_html/library/config.php on line 26

My Better Blogs config settings for Multisite looks like this:

Code:
//Configuration for Blog MultiSite
$config['blog']['multisite'] = true;
$config['cookie']['domain'] = '.8th.us';

I tried that config setting along with that. Same error. I tried it with just that setting, still didn't work.

Thanks anyway. I turned Better Blogs multisite off. I'd rather just try to get a members page vanity url addon instead.

The configs I posted were for XenForo
 
For my username I did /staff/matthew/ with route filters. If there aren't many people in the user group you could do something like that. We'll you could do it if there were lots of people just take a while.
 
How would the subdomain be created though? DNS entries would have to be created for it, which can't really be done from the xenForo side of things.

It would have to be the /<username> variety.
 
wildcards;)

How do they work? What would you put in the dns...?

Never heard of them :p

EDIT: Oh, found it. Just use the wildcard asterisk in the dns...

EDIT2: Ok, this is really useful. Now all subdomains of my forum point towards my forum URL ;) (Thanks to a htaccess entry I created to server for people using the dedicated IP...)

EDIT3: What about those sites using SSL, they would have to buy a wildcard SSL certificate ;)

Liam
 
Last edited:
  • Like
Reactions: DRE
EDIT3: What about those sites using SSL, they would have to buy a wildcard SSL certificate ;)

Liam
They would also need something to handle outside links cause outside links and embedded pictures make the page unsecure.
 
Great job dude this is officially my favorite addon on XenForo. It's so simple. Been trying to get this done on vBulletin 4, gave up and got it done on XenForo. Gonna donate when I get off work, on my way to Wingstop to try out their lemon pepper and garlic parmeson wings for the first time.

wingstop.jpg
 
Top Bottom