My b2evolution Version: 4.0.3
Hi,
I have a primary domain www.kiore.com and also have www.weblog.co.nz hosted as another blog on the same instance of b2evolution.
This works, but if I enter the site as as weblog.co.nz (i.e. without the www.) the browser is redirected to www.kiore.com, not www.weblog.co.nz
I've fixed this by hacking .htaccess to add
# Force urls to begin with www
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
I was wondering if there's an official or even more-robust way to get the domain name aliasing right inside b2evolution?
Thanks
Bruce[/code]
b2evo searches for a known blog by its absolute URL (if that's what you set on URLs tab).
.htaccess redirect to www is the simplest solution in your case