I created an .htaccess file and used the following redirects
- Code: Select all
RewriteEngine On
RewriteBase /
RedirectMatch 301 ^/home/modules/blog(.*)$ http://blog.blah.com$1
RedirectMatch 301 ^/home/blog(.*)$ http://blog.blah.com$1
RedirectMatch 301 ^/blog(.*)$ http://blog.blah.com$1
This works great. However, (you knew it was coming), I have old posts and those posts have images that exist in the folder.
http://www.blah.com/home/modules/blog/uploaded_images/
So I want to exclude the uploaded_images folder. From I could read in the documentation there are a couple ways to do this, a back reference to a parameter using rewritecond and a subsequent rewriterule with a R=301 so I did that. (The other way is with the full http_uri and I tried that too)
- Code: Select all
RewriteEngine On
RewriteBase /
RewriteCond $1 !uploaded_images/
RewriteRule ^/home/modules/blog(.*)$ http://blog.blah.com$1 [L,R=301]
RedirectMatch 301 ^/home/blog(.*)$ http://blog.blah.com$1
RedirectMatch 301 ^/blog(.*)$ http://blog.blah.com$1
The RedirectMatch rules still work, but the new RewriteRule does not. So existing blog posts found at
http://www.blah.com/home/modules/blog/2 ... -post.html
no longer redirect to http://blog.blah.com/2009/06/blog-post.html like they should.
My images don't redirect either, but that's a good thing I guess. If I remove the RewriteCond it doesn't change anything. I think it's something wrong with the rewriterule but I can't figure it out. I've stared at it for 2 days and read everything I could find. HELP!!