+1-888-365-2779
Try Now
More in this section

Forums / Deployment / How to keep links and images from breaking during deployment

How to keep links and images from breaking during deployment

10 posts, 0 answered
  1. John
    John avatar
    14 posts
    Registered:
    07 Nov 2008
    22 Nov 2008
    Link to this post
    Hi, I'm having a problem where I have a site set up in the site manager
    (C:\Program Files\telerik\Sitefinity3.5\WebSites\MyLocalSite). This site uses the same database server as the deployment server, so when I deploy, i simply upload it to the server, and set up IIS.

    Everything works just fine, except one thing:

    Any  links within page content that point to internal sub-pages are broken. These links had been added by clicking "Select a page from this site" from the Insert a Link dialog. Whenever you add a link this way, it seems to create a server-relative-absolute path (e.g. \MyLocalSite\MySubPage.aspx). Since the deploy locaton has a different path (it's in the root) the links break.

    The same goes for images that are inserted using the "Set Image Properties" dialog.

    Am i doing something wrong when deploying?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Nov 2008
    Link to this post
    Hello John,

    Thank you for using our services.

    Take a look at the following troubleshooting article Broken Image Links after Deploying to a New Server

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. John
    John avatar
    14 posts
    Registered:
    07 Nov 2008
    24 Nov 2008
    Link to this post
    Thank you Ivan, I have looked at that article and tried running those queries. However, when doing so, no rows are affected.

    When investigating in the database itself, in the actual content of the controls (in the sf_CmsTextContent table) does not contain '/VirtualDirectory/' the links are server-relative absolute paths. Every time i add a new link to my site on my local computer, it makes the url in the database '/MyProject/MySubPages/MySubPage.aspx', which breaks when I deploy my production site (because i'm deploying it to the root of my production site).

    Just for clarity, here's my process:

    1. Go to a page and add some generic content, and edit it.

    1. 2. Insert a link throught the wsywg editor.

    2. 3. In the "Insert Link" dialog, choose "Select a page from this site".

    3. 4. Select a sub page (two levels down).

    4. 5. Go to the database and find the row for the control you just edited in the sf_CmsControlPanelProperty table.

    5. 6. In the Value field, find the html for the link that was just added.

    In my case, the href attribute for the link is: /MySite/MySubPages/MySubPage.aspx

    This is what breaks when deploying.

    Any ideas?

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Nov 2008
    Link to this post
    Hi John,

    Have you replaced '/VirtualDirectory/' with your virtual directory name? Example: '/MySitefinityProject/'. Generally the virtual directory has the project's name.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. John
    John avatar
    14 posts
    Registered:
    07 Nov 2008
    02 Dec 2008
    Link to this post
    OK, I feel dumb, cuz  I guess i didn't understand the instructions very clearly. Perhaps they could be rephrased to say something like:

    If you have added your images through the Image control, run this script into the database:
    UPDATE sf_CmsControlProperty SET Value = REPLACE(Value, '/<OldVirtualDirectory>/', '/') WHERE (Value LIKE '%/<OldVirtualDirectory>/%')

    Where <VirtualDirectory> is the name of the virtual directory of the previous location.


    So, is this an issue that the Dynamic Link Parser should take care of? It did not for me...
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Dec 2008
    Link to this post
    Hello John,

    Thank you for your feedback. The problems is related to the dynamic link parser as it is described in the troubleshooting thread. I believe that everything works fine at your end.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. JohnGassman
    JohnGassman avatar
    18 posts
    Registered:
    03 Nov 2006
    01 Jan 2009
    Link to this post
    Hello,

    I am having issues with image links for images added via the radEditor as well. Can someone explain what is happening here? Are we going to have to tell our client that they have to run a SQL script to fix links every time they deploy content from one server to another? What happens if the same content should be accessed from two different sites?

    Running a global replace in SQL seems like a high-risk approach.

    Regards,
    John Gassman
    Workstate Consulting
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Jan 2009
    Link to this post
    Hi JohnGassman,

    By appending the protocol, domain and port to the front, the Dynamic Link Parser changes the links with a URL in the local machine to absolute links, independent of the application or server name. Content is changed only on demand and stays unmodified in the database.

    We will try to automate this process in the future.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. JohnGassman
    JohnGassman avatar
    18 posts
    Registered:
    03 Nov 2006
    05 Jan 2009
    Link to this post
    Hey Ivan,

    Thank you for the response. When you talk about appending the protocol, domain and port, what do you mean? Where would I do that? In the image or link editors in the radEditor - that would add a huge burden for training users how to add/edit content in the site.

    Any idea when we might see some kind of automatic handling for this? I've written similar tools that parse these paths on save, and add a "token" that is replaced the the current application root when the content is accessed.

    Thank you!

    Regards,
    John Gassman
    Workstate Consulting
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Jan 2009
    Link to this post
    Hello John Gassman,

    Yes, you should add these url properties in the RadEditor.
    In Sitefinity 4.0, all pages will be dynamically resolved when they are moved in the Sitemap. In other words, Sitefinity will take care about all URLs automatically.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
10 posts, 0 answered