Recent Topics

1 Aug 17, 2006 18:01    

I have tried to implement subdomains which each has its own blog in the 1.8 beta (summer) release. But help is needed:

I can get the blog to call the subdomains by using this explanation in the wiki: http://manual.b2evolution.net/MultipleDomains

The blog shows ok, but it does not remember that I am logged in and the Captcha does not show images.

My guess is that it is the session cookies that is causing the problem - I altered the /conf/_advanced.php as show but it did not help

One further problem: when I call the subdomain direct it does not have a file. I guess some kind of file is needed in each subdir. I tried to put an altered version of the index.php in there and it call the blog, but only the general blog - not the blog for the subdomain.

the main b2evo is installed in domain.com/blog

Can anyone please help?

2 Aug 18, 2006 18:08

Have you read and applied the "Cookies" section on the manual page?

Also, what "directories" do you mean? I've just added a "Setup your webserver" section to the manual page, to make clear that you only have a single directory, for all (sub)domains.

3 Aug 18, 2006 20:13

blueyed wrote:

Have you read and applied the "Cookies" section on the manual page?

Yes I have put it as it is on the manual page.

Also, what "directories" do you mean? I've just added a "Setup your webserver" section to the manual page, to make clear that you only have a single directory, for all (sub)domains.

My dirs are as follows:

blog is installed to
public_html/blog

the subdirs are in
public_html/subdir

what files should I put in the subdirs??

4 Aug 18, 2006 22:45

I have multiple domains/subdomains/locations going to my blog and i just modify my _basic_config.php file like so;



$tempurl = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

if(strstr($tempurl,'blogs.balupton.com'))

	$baseurl = 'http://blogs.balupton.com/';

else if(strstr($tempurl,'localhost/DevSite'))

	$baseurl = 'http://localhost/DevSite/b2evolution/blogs/';

blueyed, why couldn't this be the recomended way?

5 Aug 19, 2006 00:47

You can manually set $baseurl like you do, of course.

But IMHO the cleanest solution is to have just ServerAliases, redirect them all to the single index.php file in /blogs/ and let b2evo detect which blog gets called.

With the above "$baseurl-hack": that's for different installations, not domains.

chrpeder: you don't need any subdirs..!

6 Aug 19, 2006 00:58

that's for different installations, not domains.

I cut some of it out;


$tempurl = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];

if(strstr($tempurl,'localhost/')){

	$db_config = array(

		/* cut */

	);

}else{

	$db_config = array(

		/* cut */

	);

}

if(strstr($tempurl,'blogs.balupton.com'))

	$baseurl = 'http://blogs.balupton.com/';

else if(strstr($tempurl,'localhost/DevSite'))

	$baseurl = 'http://localhost/DevSite/b2evolution/blogs/';

else if(strstr($tempurl,'localhost/PubSite'))

	$baseurl = 'http://localhost/PubSite/b2evolution/blogs/';

else if(strstr($tempurl,'balupton.com/blogs'))

	$baseurl = 'http://balupton.com/blogs';

else if(strstr($tempurl,'balupton.nghosting.org'))

	$baseurl = 'http://blogs.balupton.nghosting.org/';

else if(strstr($tempurl,'balupton.nghosting.info'))

	$baseurl = 'http://blogs.balupton.nghosting.info/';

else die("You are accessing this blog from a unknown location. - goto http://blogs.balupton.com instead.");

unset($tempurl);

9 Aug 19, 2006 23:21

You lost a not so technical guy like me.

Exactly what steps do I need to do in order to set up blog for

sub1.domain.com
sub2.domain.com
etc.

How do I do it via redirects/aliases? Skip the instruction in the manual and do some other stuff?

Sorry for being stupid...

10 Aug 20, 2006 02:29

chrpeder, just follow the manual, like you started with. But let the subdomains point to the exact same directory on your webspace.
Then setup the "Absolute URL" for your blogs (and use empty "stub file").
Then put the .htaccess in place.
Profit! ;)

11 Aug 22, 2006 03:22

Thanks for your patience.

It works with the subdomains - now the subdirs are pointing to the /blog

But I still have the problem that b2evo does not rember my login. So we are back to the session cookies?

B2evo does not remember me when I change between the blogs.

Do I need to alter conf/_advanced.php in any other way than:

$cookie_domain = '.example.com';
$cookie_path = '/';

12 Aug 22, 2006 23:47

No, that should be all.

But you may have older cookies around, which override those.

Again, a link would help so I could see what session cookie I get, when I visit it..

13 Aug 23, 2006 00:35

I got it to work on one of my domains now! I just had to delete the cookies - stupid me! Thanks a lot for the help! :D

But on one other site I cannot create a subdirs without it makes a seperate dir for it - subdir.site.com is also site.com/subdir

Here I can only set up a redirect for the subdomain in order to have it point to the /blog dir.

This does not

The site is http://habitusnetwork.org/blog
pedersen.habitusnetwork.org

Is there any way around this?

14 Aug 23, 2006 01:02

I solved it!

I put a copy of the index.php in the subdir directory and altered lines


require_once '/usr/home/MYPATHINFO/public_html/blog/conf/_config.php';

require_once '/usr/home/MYPATHINFO/public_html/blog/inc/_main.inc.php';

This seems to work without the modrewrite also as I see it

Thanks again for the help! :D


Form is loading...