.htaccess Subfolder Redirect

Posted by John K on Stack Overflow See other posts from Stack Overflow or by John K
Published on 2010-04-27T06:08:24Z Indexed on 2010/04/27 6:13 UTC
Read the original article Hit count: 454

Filed under:
|
|

Hey Guys & Gals,

I recently moved my WordPress website to a subfolder. I want to add a redirect in the .htaccess file so that the links to images I've uploaded originally to ~/wp-content/uploads/ will pass to ~/blog/wp-content/uploads. The .htaccess file must remain in the root folder for WordPress to read it properly. This is what I tried

Redirect /wp-content/uploads/ /blog/wp-content/uploads

That worked great, except I host other domains on this account, and all of the other domain's upload folders were being redirected in a similar manner.

Is there a way to restrict this redirect to just one domain? So that example.com/wp-content/uploads redirects to example.com/blog/wp-content/uploads, but another.com/wp-content/uploads does not?

Thanks everyone!

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about redirect