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

Different style per domain (code example) 1.x

Lets you override the style choice of the user, in this example by domain name.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Jake Bunce submitted a new resource:

    Different style per domain (version 1.x) - A code example for overriding the style choice of the user, in this example by domain name.

    Read more about this resource...
  2. Dinh Thanh

    Dinh Thanh Well-Known Member

    Nice tip. But how can we setup more than one domain / 1 installation?
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The domains would all be parked on the same site. So it's one install of XF that can be accessed by multiple domains.
    Dinh Thanh likes this.
  4. Dinh Thanh

    Dinh Thanh Well-Known Member

    Is there any way to set a specific sub forum to a domain?
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Dinh Thanh likes this.
  6. DRE

    DRE Well-Known Member

    I have two xenforo forums. I don't have time to work on the other one. Parking a domain is basically redirecting it to another site right? So basically, if I bring over all the members from that site to my 8th legion site, I can redirect members from my blackgamer.net site so that they are on the 8th legion but viewing it through a style i had created for blackgamer.net?
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It's not a redirect. My site is an example of one with parked domains:


    Notice how each domain points to exactly the same content.
  8. DRE

    DRE Well-Known Member

    i have never seen that before!!! :eek::eek::eek:

    Does this make your rank go down for duplicate content?
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Maybe. I don't care about my page rank.

    This also works with subdomains. Though that would also qualify as duplicate content.
  10. DRE

    DRE Well-Known Member

    Darn. I'll just do a redirect using the code you posted for mobile skin redirect using a subdomain.
  11. DRE

    DRE Well-Known Member

    Okay I just had idea. My site, The8thLegion has almost a hundred thousand posts compared to my other site BlackGamer which only has a hundred or so.

    If I make BlackGamer a parked domain for The 8th Legion, any thread that is from the8thlegion would show up under blackgamer's domain. What if I blocked whole forums and sections of BlackGamer from the search engine using robots.txt file or something like that. But let The 8th Legion open as normal. Would that work in preventing duplicate content?
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I can't think of a way to make that work using robots.txt.
  13. DRE

    DRE Well-Known Member


    Parked domain and search engines

    Parking domain is a handy solution, but if you are concern about Search engines traffic, you should be aware that search engines do not like to see same piece of content being serve more than one time, with a park domain setup, you are serving identical set of website and web pages, search engines will consider this content as duplicate content and this is going to affect your search engine rankings, you should have a good robots.txt instruction to block search engine crawlers on parked domains, and only allow indexing on the main domain. This will prevent the duplicate content issue in search engines and yet still able to use the parked domain feature.
  14. Digital Doctor

    Digital Doctor Well-Known Member

  15. 0xym0r0n

    0xym0r0n Well-Known Member

    Do permanent redirect to 8thlegion by doing this you are crediting 8thlegion with the content and google will not penalize you for this.

    Otherwise you more than likely will loose rank on 8thlegion. Blackgamer will not gain any rank and will probably loose any rank it has.

    *note please do research before doing anything i recommend. I merely read around a lot and this is what i remember. I'm not responsible for rank loss or other damage!*

  16. DRE

    DRE Well-Known Member

    Thanks but Google terminated my Google Adsense account for the8thlegion domain and email so I moved the whole site over to my blackgamer domain so that I can get another adsense account in my someone else's name. smh
  17. 0xym0r0n

    0xym0r0n Well-Known Member

    Yeah the same happened to me a long time ago. I followed the rules but my account was terminated due to fraudulent clicks. I NEVER clicked any of my own ads. So I spoke to them and they said I probably had a visitor who kept clicking my ads... i'm like wtf?! seriously, so can I have my account back and remove those invalid clicks??? Answer - No, because you violated the rules.

    I can't help that I had a visitor who was a little click happy. I really can't. It was an information site too, wasn't even a dang forum where I know my members personally. SO! I said screw 'em.

    Totally OT but I felt like ranting.
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That's a custom gallery I made for my site. It pulls images from a gallery forum.
    Digital Doctor likes this.
  19. bashy

    bashy Member

    Oh this is cool, was about to install an add-on to detect mobile devices but I think I'll use this method!
    That way people can choose to view the full site if they wish, thanks for this!
  20. 0xym0r0n

    0xym0r0n Well-Known Member

    This worked like it said but the issue is my users are unable to switch styles afterwards.

    It either kept them on my default style for my main domain or on the alternate style for my other domain. There was only 2 styles depending on the domain you used. They were unable to switch afterwards.

    Not a bug but I'm stating this for anyone who has a question about varied style options of users.

Share This Page