Set up a subdomain for your links

Here you can find the instructions on how to set up your own subdomain that would serve as a safety buffer for your links (instead of Sur.ly's standard safety gateway service).

  • DNS Settings

    You can enable your system to automatically replace user-posted outbound links with safe links pointing to YOUR OWN subdomain (not to Sur.ly), for example: all links like http://sur.ly/o/domain/AA000014 will change to links like http://safe.example.com/domain/ where 'safe' is your subdomain and 'example.com' is your TLD.

    For this you need to:

    1) Choose a new subdomain's name (example: safe.example.com where 'safe' is a custom name you need to choose).

    2) Sign in to your DNS management account and create new CNAME record and set external.surdotly.com there.

    Example:

    
    safe         CNAME         external.surdotly.com
    

    DNS changes may take 24 hours to propagate.

    3) To add your subdomain, please, sign in and go to Admin Panel (Account -> select your site -> Use your subdomain)

    4) Set up Sur.ly SDK according to one of the instructions below.

  • Changing panel host in Sur.ly PHP SDK

    In order to direct all your outbound links to your subdomain, you need to set one using method setPanelHost()

    
    $toolbarId = "AA000014";
    
    require_once('/path/to/surly-sdk-php/Surly.php');
    $surly = new Surly($toolbarId);
    
    $surly->setPanelHost('subdomain.domain.com');
    // panel host changed to subdomain.domain.com
    
    $customLink = $surly->processUrl("http://techcrunch.com/2014/06/22/heartbleed-isnt-dead-yet/");
    // $customLink is now http://subdomain.domain.com/techcrunch.com/2014%2F06%2F22%2Fheartbleed-isnt-dead-yet/
    

  • Changing panel host in Sur.ly Javascript SDK

    In order to direct all your outbound links to your subdomain, you need to set one using method setPanelHost()

    
    <script type="text/javascript" src="//cdn.surdotly.com/js/Surly.min.js"></script>
    <script type="text/javascript">
        var surly = new Surly('AA000014');
        surly.whiteList(window.location.hostname);
        surly.setPanelHost('subdomain.domain.com');
        // panel host changed to subdomain.domain.com
        surly.process(document.getElementsByTagName('BODY'));
    </script>
    

  • Changing panel host in CMSs supporting Sur.ly plugin

    Our plugin's feature that lets you set up subdomains on different CMSs (Wordpress, Joomla, etc) is not yet implemented but coming soon! We are proactively working to improve our plugin to enable your own subdomains on a variety of CMSs, and we are going to complete this work as soon as possible.

  • Cannot find an answer to your question?

    If you cannot find an answer to your question, or you experience some difficulties with Sur.ly integration, or you want to implement Sur.ly in non-PHP project, then contact us via form.