0

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.

1
  • 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 Commented Oct 26, 2021 at 10:08

2 Answers 2

0

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

1
  • 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' Commented Oct 26, 2021 at 13:36
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.