Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions code/SingleLocaleDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public function addIgnoredURLSegment($urlSegment=null){
* different than the detected locale of the domain.
*
* 3 Things to be aware of (while developing.. these are all accounted for here):
* � Intended Locale of the Domain (.fr, .de, .com?)
* � Page's Locale in the Database
* � i18n locale that is in the header.
* � Intended Locale of the Domain (.fr, .de, .com?)
* � Page's Locale in the Database
* � i18n locale that is in the header.
*
*/

Expand All @@ -63,7 +63,11 @@ public function contentcontrollerInit(){
} else {
//otherwise, find requested page by url, determine locale, and put us in the right domain.
$newUrl = TranslatableDomains::convertLocaleToTLD($withEndSlash=false).$this->owner->Link();
Director::redirect($newUrl);
// redirect only if specific domain is set for locale allows 'catch-all'
// behaviour (on default domain) --> how to set default domain?
if( TranslatableDomains::convertLocaleToTLD(false) ){
Director::redirect($newUrl);
}
}
} else i18n::set_locale($this->owner->Locale);
}
Expand Down