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.
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.
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.
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?
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.
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")
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.
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?
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.
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
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.
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
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?
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
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")
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
Hi Nik,
Thanks for the time on replying.
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?
is working on a reply...