Handling multiple domains?

0 views
Skip to first unread message

JDS

unread,
Apr 17, 2009, 2:58:01 AM4/17/09
to adva-cms
How to I set things up to handle www.mysite.com and mysite.com as
exactly the same thing. I've got the aliases set up in Apache so the
requests route to the same place, but I get very different responses
from Adva, and it's a real nuisance.

Marko Seppä

unread,
Apr 17, 2009, 3:11:51 AM4/17/09
to adva...@googlegroups.com
Hi JDS,

try using redirect instead of using aliases on your apache
configuration.

JDS

unread,
Apr 17, 2009, 6:32:01 AM4/17/09
to adva-cms
Mmmm, I'm no expert in Apache set up and I don't think I should have
to become one to make Adva work.

The logic is very simple;- if Site.multi_sites_enabled == false, then
get the first record in the sites table irrespective of the host. I'll
add a ticket to Lighthouse.

John Small


On Apr 17, 8:11 am, Marko Seppä <marko.se...@gmail.com> wrote:
> Hi JDS,
>
> try using redirect instead of using aliases on your apache  
> configuration.
>
> On Apr 17, 2009, at 8:58 AM, JDS wrote:
>
>
>
> > How to I set things up to handlewww.mysite.comand mysite.com as

Priidu

unread,
Apr 17, 2009, 9:39:48 AM4/17/09
to adva-cms
Hi John,

I'm redirecting with apache as well cos at the moment I don't have
time to investigate how much effort it would take to implement
redirection logic+ui with adva, however if it is very important for
you and you have time, just open ticket, fork it and request pull.
However apache redirection works fine for me currently:

<VirtualHost *>
ServerName www.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=301,L]
</VirtualHost>

<VirtualHost *>
ServerName example.com
etc...
</VirtualHost>

Cheers,
Priit

On Apr 17, 1:32 pm, JDS <jds...@gmail.com> wrote:
> Mmmm, I'm no expert in Apache set up and I don't think I should have
> to become one to make Adva work.
>
> The logic is very simple;- if Site.multi_sites_enabled == false, then
> get the first record in the sites table irrespective of the host. I'll
> add a ticket to Lighthouse.
>
> John Small
>
> On Apr 17, 8:11 am, Marko Seppä <marko.se...@gmail.com> wrote:
>
> > Hi JDS,
>
> > try using redirect instead of using aliases on your apache  
> > configuration.
>
> > On Apr 17, 2009, at 8:58 AM, JDS wrote:
>
> > > How to I set things up to handlewww.mysite.comandmysite.com as

Sven Fuchs

unread,
Apr 20, 2009, 5:53:48 PM4/20/09
to adva...@googlegroups.com

On 17.04.2009, at 12:32, JDS wrote:
> Mmmm, I'm no expert in Apache set up and I don't think I should have
> to become one to make Adva work.

I wouldn't completely agree that redirecting a request requires you to
become an Apache expert :)

In fact I believe it's the "right" way to handle your scenario.

Still ...

> The logic is very simple;- if Site.multi_sites_enabled == false, then
> get the first record in the sites table irrespective of the host. I'll
> add a ticket to Lighthouse.

... I think there's something to this. There's no real point why
people should need to set a host name at all, or am I missing
something? We could always use the current hostname in this case, no?

voodooz

unread,
May 6, 2009, 2:39:15 PM5/6/09
to adva-cms
That's the way I'd would (and do w/my little low tech cms).
I use a version of http://dev.rubyonrails.org/svn/rails/plugins/account_location/lib/account_location.rb
and just grab the current site given it's host. The way I handle it is
all sites have a subdomain like username.cms.com but the site can also
be domained - that is usernames-site.com. Domaining in this way has
been a big plus for me.

The set up in apache is cake also. I just wildcard the *.cms.com
domain and make sure the cms is the 'default' site in apache (if I
remember right by making it first or last in the alphabet in hosts/
enabled-sites) this way all the sites are feed thru there if they
don't have their own .conf file. Probably not best practice but works
pretty good for me.

The other thing I do, which probably is not done for some good reason
in other better cms's, is keeping my styles and layouts in the db -
and just assume that more than one domain is going to be supported.
This way I can just copy whole sites - layout (using liquid), style,
and pages in one or two clicks. Very handy. ( and cache the css)

I sure do like the use of engines. They make great since but I'm still
getting my feet under me understanding for example how to 'build your
site within adva-cms' but I've not looked around enough yet to have a
good question but things look real appealing so far, great job to all.
Reply all
Reply to author
Forward
0 new messages