Hi guys,
Is it possible to have a 301 redirect that works for calling images on a site?
Right now, all of my pages are php-coded to look for images in /files/ but that’s moving to /wp-content/blogs.dir/1/files/.
They aren’t img src’s with the full path - it’s all Wordpress php calls to display the image. So no search-and-replace options.
I was trying to do something like this…
/files/(.*) to /wp-content/blogs.dir/1/files/$1
But it didn’t seem to do anything to the image paths.
Is there a way to accomplish this?
dklynn
2
Jason,
mod_rewrite (and mod_alias - okay, everything) works on all files.
The “better way to accomplish this” is to use mod_alias’s Redirect:
Redirect 301 /files/ /up-content/blogs.dir/1/files/
That’s precisely what mod_alias was designed to do and, because it’s part of the Apache core, it’s much faster than mod_rewrite.
Regards,
DK
Thanks DK. Much appreciated. Works like a charm.