diff --git a/core/model/RedirectorPage.php b/core/model/RedirectorPage.php index f7741dfb7..53617f720 100755 --- a/core/model/RedirectorPage.php +++ b/core/model/RedirectorPage.php @@ -53,8 +53,19 @@ class RedirectorPage extends Page { new TextField("Title", _t('SiteTree.PAGETITLE')), new TextField("MenuTitle", _t('SiteTree.MENUTITLE')), new FieldGroup(_t('SiteTree.URL'), - new LabelField("http://www.yoursite.com/"), - new TextField("URLSegment",""), + new LabelField(Director::absoluteBaseURL()), + new UniqueRestrictedTextField("URLSegment", + "URLSegment", + "SiteTree", + _t('SiteTree.VALIDATIONURLSEGMENT1', "Another page is using that URL. URL must be unique for each page"), + "[^A-Za-z0-9-]+", + "-", + _t('SiteTree.VALIDATIONURLSEGMENT2', "URLs can only be made up of letters, digits and hyphens."), + "", + "", + "", + 50 + ), new LabelField("/") ), new HeaderField(_t('RedirectorPage.HEADER', "This page will redirect users to another page")), diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 9692418c1..aa1e9629c 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1115,8 +1115,7 @@ class SiteTree extends DataObject { ), $tabMeta = new Tab('Meta-data', new FieldGroup(_t('SiteTree.URL', "URL"), - new LabelField("http://www.yoursite.com/"), - //new TextField("URLSegment",""), + new LabelField(Director::absoluteBaseURL()), new UniqueRestrictedTextField("URLSegment", "URLSegment", "SiteTree",