Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Redirector and Links require sitetree pages

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

Page: 1
Go to End
Author Topic: 636 Views
  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Redirector and Links require sitetree pages Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Redirector and Links require sitetree pages Link to this post

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

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Redirector and Links require sitetree pages Link to this post

    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
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Redirector and Links require sitetree pages Link to this post

    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
  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Redirector and Links require sitetree pages Link to this post

    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?

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Redirector and Links require sitetree pages Link to this post

    2.4.5

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Redirector and Links require sitetree pages Link to this post

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

    636 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.