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

Patrick Rodacker patrick.rodacker at the-reflection.de
Wed Mar 16 01:15:02 CET 2011


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.

Thanks
Patrick





More information about the TYPO3-english mailing list