[TYPO3-english] Best practice for multidomain and page-not-found-handling

Christopher Torgalson bedlamhotel at gmail.com
Wed Mar 16 04:11:25 CET 2011


Hello again,

On Tue, Mar 15, 2011 at 5:15 PM, Patrick Rodacker
<patrick.rodacker at the-reflection.de> wrote:
> Hi Christopher,
>
> thanks for your reply:
>
> Am 16.03.11 00:52, schrieb Christopher Torgalson:
>
>> I'm not sure I understand the reasons behind your current (complex!)
>> method, so I apologise if my suggestion is too limited for what you
>> need. In any case, I've had no problems using a method like this:
>>
>> switch ($_SERVER['SERVER_NAME']) {
>>   case 'www.example.com':
>>     $page_not_found_id = 123;
>>     break;
>>   default:
>>     $page_not_found_id = 456;
>> }
>> $url_pattern = 'index.php?id=%d'
>> $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] =
>> sprintf($url_pattern, $page_not_found_id);
>>
>> Obviously, the two main issues here are:
>>
>> 1) if you have an always-changing set of domains, this is far too
>> primitive since you'd need to add both domains and page ids, and
>
> Well I don't have an always-changing set of domains, but I wanted to move
> most of the control of the handling to the backend to be used by an editor /
> administrator. That's why I wanted to have some kind of configuration
> ability via TypoScript.
>
>
>> 2) if your editors delete the pages referenced here, your 404s break
>> (but you can prevent this by setting the ownership of the 404 pages)
>
> Your are right and that's why I still have to limit the access to the pages
> (no delete) for editors if the admin sets the TypoScript constant.
>
> What I miss at your approach is the usage of reaurl or similar url rewriting
> extensions (typolink) but I think it is not really needed.
>
> Your approach definitely has the advantage of not initializing a "virtual
> TSFE" to get TypoScript settings and use a local cObj, while content
> elements and content localization are supported.


You're right, localization is the big issue with my suggested method.
There'd be no really clean way to do it with more than one or two
languages in play.


-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list