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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Redirector and Links require sitetree pages


Go to End


7 Posts   1069 Views

Avatar
swaiba

Forum Moderator, 1899 Posts

8 February 2011 at 3:35am

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

Forum Moderator, 5523 Posts

8 February 2011 at 8:42pm

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

Avatar
swaiba

Forum Moderator, 1899 Posts

8 February 2011 at 10:23pm

Edited: 08/02/2011 10:27pm

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.

Community Member, 309 Posts

9 February 2011 at 12:08pm

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

Forum Moderator, 1899 Posts

9 February 2011 at 9:43pm

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.

Community Member, 309 Posts

11 February 2011 at 8:50pm

2.4.5

Avatar
swaiba

Forum Moderator, 1899 Posts

11 February 2011 at 10:49pm

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