XF 2.2 Is it possible to point a domain to a node category or page?

alternadiv

Well-known member
I'm thinking the answer to this is going to have the word "canonical" in it, which is a concept I never seem to understand.

Is it possible to use a secondary domain for a category of nodes or a group of pages, effectively creating a mini site within the main site?

Example:

cats.com is a cat forum
blackcats.com goes to cats.com/forum/black-cats.1/
viewing threads in the /black-cats/ node also uses the blackcats.com domain


inb4 @Brogan "why?":
To have Google index the black cat stuff separately. And to let cats.com members not have to view the /black-cats/ node, ever, if they don't want to.
 
This is what the Multisite add-on was for (not worth using in XF2 due to bugs and no updates and slow support currently), but you required two separate licenses.
 
This is what the Multisite add-on was for (not worth using in XF2 due to bugs and no updates and slow support currently), but you required two separate licenses.
I was looking into that back when it was a thing but I was very hesitant because I didn't want to compromise my database or something.
 
Is it possible to use a secondary domain for a category of nodes or a group of pages, effectively creating a mini site within the main site?
Yes, I do that with nginx web server configuration ....

Code:
server_name .blackcats.com;
return 301 $scheme://cats.com/forum/black-cats.1/;

I doesn't create a 'mini site', but i redirects your blackcats.com to cats.com category/node. Maybe that's good enough?
 
Yes, I do that with nginx web server configuration ....

Code:
server_name .blackcats.com;
return 301 $scheme://cats.com/forum/black-cats.1/;

I doesn't create a 'mini site', but i redirects your blackcats.com to cats.com category/node. Maybe that's good enough?
The redirection would be the other way for what I wanted to try.

Going to cats.com/forum/black-cats.1/ would use URLs under blackcats.com but would still just be the cats.com website/database. It would mostly be an aesthetic thing for people to remember and for Google to list.
 
URL rewriting might work if you want it to look like it's from a different domain to what it's actually on, but note the following:
  • It could be seen as the actions of malware by the browser and a/v software to hide the true domain
  • It would require a second XF license, since it's only one license per domain
    • I actually had this scenario myself a few days ago when I changed my site's domain. Literally site1.com and site2.com would both point to the same physical website during the transition period, with the different domains showing and the SSL certs working properly for each one, too. The bit after the / was the same in each case and delivered the exact same content. Very odd looking lol.
@Brogan you might want to wade in here for clarification, especially regarding the license.
 
It would require a second XF license, since it's only one license per domain
That’s how I interpret it. I don’t understand how it can be done with only one database.

But will it keep the domain when you navigate pages under that directory? I don't want it to just switch back to cats.com (although that is what I'll fall back on if this can't be done).
Switching back to cats.com would confuse me as a user.
 
That’s how I interpret it. I don’t understand how it can be done with only one database
It could work with one database by just black cats as a subforum of cats. Using web server rewrite rules the site could internally know which forum is being accessed.

It's not on though, because it's obviously trying to get round the second license requirement and as you say, confusing for the user.
 
That’s how I interpret it. I don’t understand how it can be done with only one database.
It can be done (we are using a somewhat similar approach on fitness.com to separate the languages), but does require custom code.
https://www.fitness.com/en/forum
https://www.fitness.com/es/forum
https://www.fitness.com/de/forum

This is all just one DB.

Switching back to cats.com would confuse me as a user.
That and it would definitly cause usability issues due to cookies not being shared across domains.
So why it might theoreticaly be doable, I wouldn't advise to do that.
 
Last edited:
It could work with one database by just black cats as a subforum of cats. Using web server rewrite rules the site could internally know which forum is being accessed.

It's not on though, because it's obviously trying to get round the second license requirement and as you say, confusing for the user.
I’m not trying to get around the second license. I would buy one to do this. But I’m not trying to create an entire second site. I was only looking to have a creative way to organize content. But I do see how it would be confusing for the user and mess with cookies. I’m going to drop the idea altogether.
 
I’m not trying to get around the second license. I would buy one to do this. But I’m not trying to create an entire second site. I was only looking to have a creative way to organize content. But I do see how it would be confusing for the user and mess with cookies. I’m going to drop the idea altogether.
That's ok, it's good to sound out ideas and learn stuff and I didn't mean to suggest that you were looking for a way round the license, just that it could be used in that way.

Talking of learning, in my case, I only discovered the other week that it's possible to have two domains point to the same physical site on the same web server and have them both work perfectly. It was the oddest thing! I guess one could extend this to any number of domains, although pointless.
 
The redirection would be the other way for what I wanted to try.

Going to cats.com/forum/black-cats.1/ would use URLs under blackcats.com but would still just be the cats.com website/database. It would mostly be an aesthetic thing for people to remember and for Google to list.

Just be aware that redirection won't help with your goal of having both sites listed in Google.

Google will follow the redirect to the destination and index the site at the canonical URL, not the domain used as the source.

URL rewriting might get you closer - but you'll likely need to modify XenForo because it will continually try to return the original site URL in links.
 
Back
Top Bottom