Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Hudiel 32 posts 102 karma points
    May 25, 2018 @ 17:19
    John Hudiel
    0

    Not using Media ID in URL of images uploaded

    Hi Guys,

    Our client already has a website and they just want to move it to umbraco.

    We are almost done with it however, there is a specific request when it comes to images that is being uploaded in Umbraco website.

    The client wants to basically remove and change the url being generated by umbraco from "/media/1002/unique-funeral-1400-500-2x.jpg" to "/img/unique-funeral-1400-500-2x.jpg" which is where the image is previously stored when its not in the umbraco.

    Is there any way to do this? currently trying to move the location first and can't seem to have a luck in that.

    Thanks in advance.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 26, 2018 @ 08:33
    Jan Skovgaard
    0

    Hi John

    Is it a client demand that the path must be "/img/imagename.jpg" or is that you conclusion to a wish that the client will not need to re-select each inserted image once you have moved the site to Umbraco?

    I'm asking since I'm wondering if what the best approach could be here. Because I don't think that the right path is to change the media path since that can lead to some very poor experiences once you'll need to upgrade Umbraco and be the source of a lot of frustrations.

    Before we get anymore specific about possible solutions can you then elaborate a bit more on your approach of moving the site? Is it being moved from another CMS or is it a static site currently? And are all images currently being referenced from rich text editors?

    It would be good with some more detail since that will make it easier to suggest possible solutions for you.

    Looking forward to hearing from you.

    Cheers, Jan

  • John Hudiel 32 posts 102 karma points
    May 29, 2018 @ 08:38
    John Hudiel
    0

    Hi Jan,

    Thank you for replying and I am sorry for taking so long to reply. It's a long weekend here where I am.

    In regards to your first question, it is not my conclusion. They specifically wish to have the location on a different path with the same url as the one that is up on the site.

    We are moving from a static site and not from any CMS. They are saying we should do this as to not affect the SEO that the current site has built up.

    Currently what I did is I moved my folder where all images to the root of the site so that all images doesn't need to change the url in the current code that we have migrated.

    Will really appreciate any help that can point me in the right direction for this. This is my first CMS site so please bear with me.

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    May 29, 2018 @ 08:46
    Paul Seal
    0

    You could go about it in a different way.

    You could add rewrites for the original image paths that go to their new locations. That way you don't lose the SEO.

    Although having said that, if you put the permanent redirects in for the old pages to the new pages, that should sort out your SEO anyway.

    Kind regards

    Paul

  • John Hudiel 32 posts 102 karma points
    May 29, 2018 @ 11:22
    John Hudiel
    0

    Hi Paul,

    So I could just add rewrite rules to the images from the old location to point to the new ones? However, wouldn't this be a bad idea as I will need to write rule for every image that is affected, as the url for the new location contains an ID for that specific image?

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 29, 2018 @ 12:02
    Nik
    0

    Hi John,

    Just jumping in on this as another option could be to create a custom route to your own controller. So, if someone came in on the /img path you take the next part of the url as the file name.

    You could then search your new media for this file and return the correct redirect, or a generic one if it's not found. This would mean you don't have to build up a map for all the images from the old site.

    Just a thought.

    Nik

  • John Hudiel 32 posts 102 karma points
    May 29, 2018 @ 12:11
    John Hudiel
    0

    Hi Nik,

    Thanks for the reply, I will hold on to this idea as I really have no final word on this.

    Any pointers on how I can do it the other way? Removing file ID on the URL and having the url links for the images the same way as static site does? (i.e. "folder/subfolder/filename.jpg")

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 29, 2018 @ 14:05
    Nik
    1

    I'm afraid not John. If you wanted to try and have the old URL's stay consistent I don't believe it would be possible as the media pickers and media links would all use the Umbraco structure.

    If you are forced down that route you would (I think) have to write your own media provider for Umbraco that stores the files in the locations you expect and some sort of tracking to associate them with the media items in the back office. It could end up getting very complicated and not worth the time. I could be wrong and someone else here might have a way to achieve it in another manner.

    Nik

  • John Hudiel 32 posts 102 karma points
    May 30, 2018 @ 08:15
    John Hudiel
    0

    Hi Nik,

    Thanks for the time on replying.

  • John Hudiel 32 posts 102 karma points
    May 30, 2018 @ 08:46
    John Hudiel
    0

    HI Guys,

    One more thing, I know this is stretching this to the limit but inline with the topic of media ID being in the URL of the uploaded images. With the current way that the urls for the images are formed, having images with their ID on the URL, it is not really SEO friendly. Any ideas on how to make it more SEO friendly?

Please Sign in or register to post replies

Write your reply to:

Draft