I have a new WordPress site, example.com, with the old Drupal site archived at archive.example.org
. Many files on the old site had a URL like so (ex: example.org/files/foo.pdf
), but all those links out there in the internet are breaking because all those file downloads need to be redirected to archive.example.org/files/foo.pdf
.
Can creating redirects (I'm guessing .htaccess
is the best bet) work for file downloads as well? Is there a simple redirect to send all old links to the archive subdomain?
I have tried:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/files/
RewriteRule ^ http://archive.example.org%{REQUEST_URI} [R,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
...with no luck so far.
Thanks for any help!