Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Getting Started > Using TYPO3 > Autoconfig RealUrl with 2 or more Root Pages in one Installation
Total Posts: 7 - Pages (1): [1]
Author: Andi Becker
Posted: Jul 04 2008 - 08:23 AM
Subject: Autoconfig RealUrl with 2 or more Root Pages in one Installation
Hi

I am just came over a strange problem. Perhaps I can't see the solution as I worked more with cooluri in the last years. With cooluri it is working but WEC is using RealUrl and therefore for a training it should work with realurl too.

- ROOT A1
------ Page A1
------ Page A2
----------- Page A2.1
------ Page A3

- ROOT B (This is actually the original WEC Site PID 61)
------ Page B1
------ Page B2
----------- Page B2.1
------ Page B3

- GRSP (PID 31)


As you can see we created a new site A above the ROOT B ahich is the original WEC Site
We copied the template from PID 61 to ROOT B and assigned a new Site template and Marked this page as ROOT also in Edit Page Header. PID 31 is assigned as GRSP.

Everything works fine but the site A gets called with index.php instead of using REALURL and subpages get redirected to the notfound page of A as they show index.

As WEC is now using the autoconfiguration feature I could change the ROOT PID in the autoconfiguration file - I won't like to do this as it would make "auto"configuration absurd! (auto-manual-configuration)

I could also start adding again code into localconf.php like:
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['enableDomainLookup'] = 1;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domainA.com'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domainA.com']['pagePath']['rootpage_id'] = 80;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domainB.com'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domainB.com']['pagePath']['rootpage_id'] = 61;


With cooluri I would only create another domain record and check the multidomain ability that's it. But how can I now get this working in RealURL without as autoconfig.

Perhaps (haven't tested) the problem would even exist if I replace the ROOT B PID 61 by another Page to be ROOT B. How does autoconfig change this change also in the autoconfi file??

Thanks a lot

Andi
Author: Andi Becker
Posted: Jul 04 2008 - 12:15 PM
Subject: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
Update:
If you disable or delete PID 61 still those pages will be shown which have been created before.

In our Example above PID A2is a COPY of PID B2
As both Pages have to coexist now with the same URL RealUrl is appending a "0" to the PID A2's Name i.e. PID B2 = calendar then PID A2 will be calendar0 - but calendar0 won't show up!!!

A3 is actually B3 - B3 has been MOVED to A3 Position and this Page shows up even it is now in another Sitetree with another Root.

The RootA Page is been called without any problems as it is now at the TOP and called first. Domain Records are missing completly so the second site A can't be called again.

Conclusion by now:
RealUrl autoconfig seems not o be working with multiple sites in one installation without manual modifications. Am I right?

While in CoolUri I create a Domain Record for each site and check the multidomain box all domains get created automatically without any problems. Using jb_status_code will give me even 301 redirects.

Is such an easy way to configure your multisite TYPO3 Installation possible with RealUrl - without editing the localconf.php

Has somebody tried cbrealurl? Perhaps this would be a interim solution.

Thanks
Andi
Author: Jeff Segars
Posted: Jul 07 2008 - 12:30 AM
Subject: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
Andi,
There are a couple things to consider. The first is that the RealURL autoconfiguration file is not regenerated when changes are made. This means you need to manually delete the realurl_autoconf.php file when you add a new domain and let RealURL regenerate it. Once you do this, the new file should have entries for each domain.

You'll also want to be sure that you create domain records for each domain and don't leave the first branch of the pagetree without a domain record.

The final thing to consider is the 404 handling. There's currently no idea of multi-domain 404 handling so we fake our way into that by settings the 404 URL to /notfound/. This means that each domain on your site can have its own 404 page at the /notfound/ domain.

Hope that helps!
Jeff
Author: Andi Becker
Posted: Jul 07 2008 - 03:00 AM
Subject: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
Thanks Jeff

I deleted the realurl_autoconfig.php
I created 2 domain records one called localhost:8507 and localhost:8508
in the in c:ServerApacheconftypo3winstaller.conf I edited the vhost
to

# WEC - WEC-Starter
Listen 8507
NameVirtualHost *:8507
<VirtualHost *:8507>
DocumentRoot "C:/Server/htdocs/wec_001"
</VirtualHost>

# wec_001 - ThaiPo3
Listen 8508
NameVirtualHost *:8508
<VirtualHost *:8508>
DocumentRoot "C:/Server/htdocs/wec_001"
</VirtualHost>

-----------------
But now when I call localhost:8507 or localhost:8508 both times the same most top site in the tree gets called. It seems that the vhost is working and even the realurl seems to be working as it creates no index.php?id=.

I have tried clearing all cache - no better results
Of course I have also changed the constants for baseURL
Site 1 - constants.wec.siteURL = http://localhost:8508/
Site 2 - constants.wec.siteURL = http://localhost:8507/

Hmm is not working.
The URLs of the one site get called like localhost:8508/104/ (this is the PID)
or localhost:8508/calendar0/ (perhaps because there is also a page called calendar in the other site.)

Any other solutions?
Andy
Author: Andi Becker
Posted: Jul 07 2008 - 03:05 AM
Subject: re: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
It seems that the realurl_autoconfig.php is not able to handle multiple domains as it only creates one and loney URL entry (in our case 8508 - 8507 is completely missing)

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=unserialize('a:2:{s:14:"localhost:8508";a:4:{s:4:"init";a:6:{s:16:"enableCHashCache";b:1;s:18:"appendMissingSlash";s:9:"ifNotFile";s:18:"adminJumpToBackend";b:1;s:20:"enableUrlDecodeCache";b:1;s:20:"enableUrlEncodeCache";b:1;s:19:"emptyUrlReturnValue";s:1:"/";}s:8:"pagePath";a:7:{s:4:"type";s:4:"user";s:8:"userFunc";s:68:"EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main";s:14:"spaceCharacter";s:1:"-";s:14:"languageGetVar";s:1:"L";s:11:"rootpage_id";s:3:"102";s:19:"autoUpdatePathCache";b:1;s:10:"expireDays";i:14;}s:8:"fileName";
Author: Jeff Segars
Posted: Jul 07 2008 - 11:18 AM
Subject: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
Andi,
I tested this on one of our servers and multiple domains are working for me. If it gives you any tips for testing, here's the configuration that is working for me.

* Started with a default Starter Package install and added a domain record for default home page (id=61)
* Added a new root page below the default pagetree and added a domain record here.
* Deleted the realurl_autoconf.php file.

After this, the resulting realurl_autoconf.php contained entries for both domains and RealURL was working for each.

Thanks,
Jeff

Author: Andi Becker
Posted: Jul 07 2008 - 11:59 AM
Subject: re: Autoconfig RealUrl with 2 or more Root Pages in one Installation
I Jeff I tried it now twice with same result.

The URLs get generated like
http://localhost:8508/105/

instead of
http://localhost:8508/blog/

and calling 8508 or 8507 results both in the same PID 61 if PID 61 is under the globe
if it is the second site it will call this site both URLs

If I place it like
---GLOBE
-------PID 61
-------------PID NEW SITE
-------------HOME
-------------...

Then I can Access PID NEW SITE of course from PID61 but the urls look the same.

Thanks for helping
Andi
Total Posts: 7 - Pages (1): [1]
You must login to post a message to this conference.