Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Redirector and Links require sitetree pages


Reply

7 Posts   691 Views

Avatar
swaiba

8 February 2011 at 3:35am Forum Moderator, 1796 Posts

Hi,

I have an issue where I am using a live DB locally - whenever someone creates a link or a redirector page within the CMS on a live site to a page within the live site, but not in the sitetree (e.g. for a director rules added page like www.mysite/Secrity/Login or where a parameter is given to a page - so again is not in the sitetree) they are creating it with "http://www.mysite.com/urlsegment" - where as to access the site locally I want to use "urlsegment".

These are being added to the "external" website - is there a workaround to allow custom pages on the same site but without providing the "http://www.mysite.com/" bit?

Avatar
Willr

8 February 2011 at 8:42pm Forum Moderator, 5511 Posts

Couldn't the user just enter the relative URL i.e urlsegment rather than the full path?

Avatar
swaiba

8 February 2011 at 10:23pm (Last edited: 8 February 2011 10:27pm), Forum Moderator, 1796 Posts

If I put just the url segment the redirector redirects to the just the urlsegment (no $BaseURL prefixing it)
And if I put a urlsegment into the link - it prefixes http:// when I hit "Insert Link"

see attached...

am I doing something wrong - is this not the case in the latest version? if so it's yet another reason to upgrade :)

Attached Files
Avatar
Ryan M.

9 February 2011 at 12:08pm Community Member, 309 Posts

Did you try putting a slash before it?

ie, /urlsegment

That should render as an url relative to your site's top level.

Alternatively, see my screenshot attached. This seems to work for me.

Attached Files
Avatar
swaiba

9 February 2011 at 9:43pm Forum Moderator, 1796 Posts

Hey Ryan,

thanks for the help but both prepending "/" or "[sitetree_link_id=]#/" didn't have the desired result - the links were still being shown as http://<whatever I type> instead of being relative to the URL. If this works for you what version are you on?

Avatar
Ryan M.

11 February 2011 at 8:50pm Community Member, 309 Posts

2.4.5

Avatar
swaiba

11 February 2011 at 10:49pm Forum Moderator, 1796 Posts

thanks - as I suspected yet another reason to up the version...