Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: istion - maaliskuu 15, 2011, 05:04:46 IP

Otsikko: 2 domains using same forums
Kirjoitti: istion - maaliskuu 15, 2011, 05:04:46 IP
Hi,  I have two domains I would like to work (without appearance of forwarding the domain) on the same forum.

So I would like .domain.com  and otherdomain.com to operate on the same forum.  If .domain is accessed that is all you see in the url and vice versa.

Is there a method/work around for this??

Thanks,

Ken
Otsikko: Re: 2 domains using same forums
Kirjoitti: SlammedDime - maaliskuu 15, 2011, 05:22:24 IP
Simply put the following code into a php file and place it in the root directory of your SMF install it, navigate to it to run it, and then delete it (if it didn't delete itself)... and that's it... your board is now accessible from both urls and will maintain the proper URL as you navigate the site.  Change the URL's to suit your needs of course.  The list of urls should be a comma separated list of urls that are aliases to your main domain.  You can include your main domain (as I would) in the list as well just for easy maintenance in knowing all aliases you use for your board.

<?php

require_once('SSI.php');

updateSettings(array('forum_alias_urls' => 'http://mydomain1.com/path/to/smf, http://mydomain2.com/path/to/smf'));

unlink(__FILE__);


To see the code on how this works, you can check Sources/Load.php, just search for 'forum_alias_urls'
Otsikko: Re: 2 domains using same forums
Kirjoitti: Adrek - kesäkuu 12, 2011, 04:15:49 IP
will this work with SMF 2.0 ?
Otsikko: Re: 2 domains using same forums
Kirjoitti: ApplianceJunk - kesäkuu 12, 2011, 06:09:24 IP
Interesting, what if you want to stop using it?
Otsikko: Re: 2 domains using same forums
Kirjoitti: IchBin™ - kesäkuu 27, 2011, 10:27:35 AP
If you run the same script again, but remove the domain you don't want that should take care of it.
Otsikko: Re: 2 domains using same forums
Kirjoitti: lorth - kesäkuu 30, 2011, 09:23:22 AP
i tried this, and it seems to load everything from the domain i load the forum with, except for the smileys.
any idea how to fix this?
Otsikko: Re: 2 domains using same forums
Kirjoitti: lorth - kesäkuu 30, 2011, 10:24:36 AP
my mistake, i didn't fix the smiley-url.
works like a charm now.
Otsikko: Re: 2 domains using same forums
Kirjoitti: JimM - heinäkuu 20, 2011, 09:29:25 IP
Great, so I'll mark this one solved. :)