Topic: Managing multiple Domains / sub sites with MODx  (Read 21811 times)

Pages: [1] 2 3 ... 5   Go Down

#1: 6-May-2009, 10:45 AM

Moderators

MadeMyDay
Posts: 966

WWW
Just finished the first version of a tutorial which describes the usage of MODx for managing multiple domains / sub sites without hacking the core.

Tutorial: Multiple domains / sub sites with MODx

Feedback welcome!

#2: 6-May-2009, 11:16 AM

Coding Team

sottwell
Posts: 12,261

WWW
Wonderful stuff  Cool
How MODx Works
Log in to an Evo Manager username guest, password guestuser.

#3: 7-May-2009, 03:25 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
Nice tutorial! I'll try it on my project and tell about results.

#4: 7-May-2009, 05:24 AM

Moderators

MediaGuy
Posts: 726

Mediaguy.eu

WWW
Very nice! I think I can use this for a upcoming project Smiley
with regards,

Ronald Lokers
'Front-end developer' @ h2o Media

#5: 7-May-2009, 11:25 PM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
While using tag like this:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">

When we are on general Home (e.g. on 404) plugin replaces this line to
Code:
index.html xmlns="http:/www.w3.org/1999index.html">
so it become viewable on the top of page.

I think the problem is somewhere in unrigorous regexp in "multisite" plugin.

UPD:
I just localize the problem: this was happening when I haven't domain specific 404 page, so modx go to default 404 page (from settings) AND on the general 404 page TV "host" is not specified. So regexp bugging.

Hence the question follows that which domain would I set in TV in general pages?
« Last Edit: 8-May-2009, 12:21 AM by Andrey Nagikh »

#6: 8-May-2009, 04:18 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
So, I found the reason.
Then TV is blank, this regexp
$modx->documentOutput=preg_replace("#/?".$host_url.".html#i","index.html", $modx->documentOutput);

match <html> tag
You just need to escape "." like this
$modx->documentOutput=preg_replace("#/?".$host_url."\.html#i","index.html", $modx->documentOutput);

#7: 8-May-2009, 07:22 AM

Testers

ganeshXL
Posts: 2,054

true is true

WWW
Awesome news. Thanks for this tutorial! Makes me want to buy 3 random domains just to test this out :-)

#8: 8-May-2009, 07:54 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
Makes me want to buy 3 random domains just to test this out :-)
Ha! You can do it on local server where you can make 100 domains :-) Or, it also work with subdomains of 3rd level. Any what you want!

#9: 8-May-2009, 08:25 AM

Moderators

MadeMyDay
Posts: 966

WWW
Quote
match <html> tag
You just need to escape "." like this

Thx! I corrected this in the tutorial. Wasn`t a problem for me since I don`t have a standard domain ;-)

#10: 8-May-2009, 08:39 AM

Testers

ganeshXL
Posts: 2,054

true is true

WWW
@Andrey Nagikh: how would I do that? Edit the httpd.conf file directly? Or add a few lines to the HOSTS file (I'm on Windows XP using a regular WAMP install) ?

#11: 8-May-2009, 09:01 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
@ganeshXL
Both. You should add all new hosts to HOSTS file (both with www and w/o). And then add all this hosts to VirtualHost section in ServerAlias directive. Actually I don't remember right syntax, so use the documentation for this directive.

I use russian all-in-one complex D.n.w.r. (WAMP) and it's much simplier to do it, because it's pretty configurable. I think there are some all-in-one complexes on English language exist.

#12: 8-May-2009, 09:02 AM

Moderators

MadeMyDay
Posts: 966

WWW
@Andrey: Beside the problem with the regex, did the tutorial work for you?

#13: 8-May-2009, 09:15 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
@MadeMyDay
In general, the tutorial work. But I don't finish testing yet.

Now 2 nested questions are about to happen:
1. Could I insert link on one subsite to page from another subsite
2. Multilanguage support. (I use solution from Wiki, and it's not so good)

#14: 8-May-2009, 09:38 AM

Moderators

MadeMyDay
Posts: 966

WWW
1. Good question. If you put in the complete link (by hand) it should work. A [~45~] link will not work I think, because it will generate a link to the same domain (because of the base href). I would be perhaps possible to intercept the onDocFormSave and look for internal links, look where they belong to and rewrite them to the correct domain. Will look into this, but next week.

2. No automatic stuff yet. But perhaps there is something on the horizon... A friend of mine is dealing with this topic, he wanted to create a set of plugins for a better language handling. I will ask him how far he got yet. 

#15: 8-May-2009, 10:41 AM


Andrey Nagikh
Posts: 562

Sorry for my ugly English

WWW
@MadeMyDay
1. A [~45~] link will not work I think
Yep. It generates such link: http://one.domain/other-domain-alias/page.html and after clicking we get 404 page.
I will look through

2. I will ask him how far he got yet. 
It would be great! Is he on forum?

#16: 8-May-2009, 10:55 AM

Moderators

MadeMyDay
Posts: 966

WWW
Quote
It would be great! Is he on forum?

Yes, it`s Stefan. Look for "content history", he already wrote a plugin for document versioning.

#17: 9-May-2009, 08:13 AM

Moderators

Onesmarthost
Posts: 614

I love MODx!

WWW
This look pretty neats.

Is it possible to restrict the available templates to a specific domain i.e. www.domain1.com can only access and see domain1.com template?

Thanks Aaron
Aaron Wardle

http://www.onesmarthost.co.uk/modx-hosting-offer.html // UK Web Hosting with lots of MODx Love..
Free MODx EVO 1.0.4 or Revolution 2.0 Install
Free transfer from existing web host!

#18: 10-May-2009, 03:04 AM


sal
Posts: 116

WWW
Props Aaron, yet to try it out but will when I get the chance, it all makes sense from a brief look though.
Is it possible to restrict the available templates to a specific domain i.e. www.domain1.com can only access and see domain1.com template?
I'd say leave this either down to standard MODx user management (editors for domain1.com can only use domain1.com templates, etc) or admins shouldn't be dumb enough to mix templates if they'd normally break on an incorrect domain.

#19: 10-May-2009, 05:54 AM

Moderators

Onesmarthost
Posts: 614

I love MODx!

WWW
From what I understand today with MODx there are no permissions you can get on Templates.

I have a similar issue at the moment where a site has 10 templates depending on type of page to be published. The problem we have today is that yes we can create roles for news editors and lock them down to the news folder tree there still seems to be no way to lock down on templates allowed to use, so a news editor could infact create a page using a blog template for example.

If I'm missing the obvious let me know Smiley
Aaron Wardle

http://www.onesmarthost.co.uk/modx-hosting-offer.html // UK Web Hosting with lots of MODx Love..
Free MODx EVO 1.0.4 or Revolution 2.0 Install
Free transfer from existing web host!

#20: 10-May-2009, 08:08 AM

Testers

ganeshXL
Posts: 2,054

true is true

WWW
You could try the ManagerManager plugin: http://modxcms.com/extras.html?view=package/view&package=255
http://modxcms.com/forums/index.php/topic,33291.0.html
Pages: [1] 2 3 ... 5   Go Up
0 Members and 3 Guests are viewing this topic.