Redirect all files of a type with htacess
I'm cleaning up my web space and I have moved all PDFs from the top
directory to a lower level one. I'd like to redirect so that the old URLs
still work. What I have so far is
RedirectMatch 301 (.*)\.pdf$ http://mysite.com/uploads/papers/$1.pdf
The problem is that this also redirects something like
http://mysite.com/uploads/papers/paper.pdf to
http://mysite.com/uploads/papers//uploads/papers/paper.pdf and so on,
resulting in infinite redirects.
I've tried excluding forward slashes from the matches, or the word
"uploads", but without success. Any ideas?
No comments:
Post a Comment