Score:0

redirect an old url that no longer exists related to a file to a new one

ms flag

I have 2 urls: www.example.com/somefile.pdf www.example.com/somefileNew.pdf

the first one no longer exists, i want to redirect this url to the new one. I tried to use the redirect module to no avail as the module adds the site language to the url (ex: www.example.com/**en**) since the website is multilingual.

how can i achieve this? i tried https://www.drupal.org/project/media_entity_file_redirect but cant seem to make it work.

us flag
If it’s a file under sites/default/files for example, it may be served directly by nginx and the redirect needs adding there, not in Drupal
Score:0
ms flag

Ok somehow submodule Redirect 404 fixed this, you search for the old url that no longer exists, the submodule logs it, and from there you can redirect it to a new url.

Score:0
th flag

Try a .htaccess or other web server redirect. If that won't work make sure to delete the old file and then try using the redirect module rule. You should be able to enter a redirect without specifying the language (leave as "All languages" admin interface for adding redirect

João Mateus avatar
ms flag
hi thanks for replying back, this solution doesnt work because de url already has the 'en' so whatever i mention afterwards it will always be 'www.example.com/en/somefile.pdf', i need it to be 'www.example.com/somefile.pdf'
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.