2 domains using same forums

Started by istion, March 15, 2011, 05:04:46 PM

Previous topic - Next topic

istion

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 [nofollow] 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

SlammedDime

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'
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Adrek

Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

ApplianceJunk

Interesting, what if you want to stop using it?

IchBin™

If you run the same script again, but remove the domain you don't want that should take care of it.
IchBin™        TinyPortal

lorth

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?

lorth

my mistake, i didn't fix the smiley-url.
works like a charm now.

JimM

Great, so I'll mark this one solved. :)
Jim "JimM" Moore
Former Support Specialist

Advertisement: