Try our conversational search powered by Generative AI!

ContentUrl generating 'stale' urls for media items?

swc
swc
Vote:
 

We recently restructured our media folder, moving and renaming files within it.  For the most part, everything is working correctly, but when we generate a url using Url.ContentUrl() the urls that we get seem to be built using the old file names and locations for segments, rather than the most up to date ones. 

I am assuming the urls are being cached somewhere after they are generated the first time, but it seems they persist far longer than I would have expected.  Is there a way to get the urls generated via Url.ContentUrl() to regenerate using the current file an folder names for the url segments?  

It is fine if the old urls still work, I just want all urls we generate going forward to reflect the new file structure.

Thanks!

#145392
Mar 03, 2016 4:28
Vote:
 

Try changing the url segment on file. Just renaming won't change url segment. There is a small SEO hit for this so try not to do it too often or set up 301s when you do. You can change the url segment in edit mode (or programmatically)

#145393
Edited, Mar 03, 2016 7:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.