Recent Topics

1 Dec 06, 2006 21:23    

I have what I think is kind of a unique situation.

I have a content management system for folks with their own websites on their own domains. I would like to display the same news blog on each of our clients domains and have it appear to be part of their site. I have created a skin which will automagically match the look of each different site.

I have b2evolution installed here
http://www.mycmsdomain.com/b2/

I have set up an alias in apache
Alias /b2 "/path/to/my/b2/instalation/"

so now the news blog can be seen at each domain. like so:
http://www.siteA.com/b2/
http://www.siteB.com/b2/
http://www.siteC.com/b2/
http://www.siteD.com/b2/

all looks and works great except for the links inside the blog. the links all point to what is set for $baseurl which is http://www.mycmsdomain.com/b2/

in other words if I go to http://www.siteA.com/b2/ then click on the "Leave a Comment" link, it take me to the install domain: http://www.mycmsdomain.com/b2/index.php?title=...

I can, of course, change the baseurl to http://www.siteA.com/b2/ but that does not help siteB.com

I have played around with stub files a bit but I can't seem to set $baseurl in a stub file.

Does anyone have any Ideas how I can change the links so they point to the correct domain?

2 Dec 07, 2006 22:00

I found a solution to my problem in this feature request

http://forums.b2evolution.net/viewtopic.php?t=8949

A cleaner solution would be most welcome but this hack of _basic_config.php does what I am looking for:


$baseurl .= "http://" .$_SERVER['HTTP_HOST'] . "/myb2evolutionSubDir/;

this allows the $baseurl to be any domain which can reach it.

3 Dec 08, 2006 00:51

What about using "Absolute URL" like said in the topic you're refering to.

Or do you want to have the _same_ blog(s) on each of the domain?

Your "hack" is the cleanest solution I can think about then.. (apart from having a list of hosts somewhere which would get checked/compared, but which is unneeded with most setups.)

What's wrong about your "hack"? How would you want to configure "the clean solution"?

4 Dec 08, 2006 19:09

Yes, I want to have the _same_ blog(s) on each of the domains.

This solution works very well for me, nothing wrong with this hack at all. I've been testing it and It works very well.

I was checking to see if there is a way to do this without modifying the php file. For example an option in the url parameters to "Use dynamic http_host name in base url".

This is really a nice piece of software!! I have tried to use several other blog systems and was not able to get this working. Thank you!

5 Dec 08, 2006 20:03

You're welcome.

I would not call this a "hack". It's an advanced/specialized setup.. :)


Form is loading...