WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found that the following code online could be used to spoof the WordPress uploads folder, rewriting URLs to a different folder on the server:

# BEGIN Spoof wp-content/uploads directory
RedirectMatch 301 ^/uploads/(.*)$ https?://yoursite.com/wp-content/uploads/$1
# END Spoof wp-content/uploads directory

It is my understanding that under Media settings page the 'Full Path to files' needs to point to desired spoof folder.

I have tried using the above code but WordPress throws a error 404. My uploads are set to be organized by year and month. The file was that uploaded and tested indeed exists on the server.

Here is an example of the structure setup:

Real folder path -> http://yoursite.com/wp-content/uploads/2011/09/icon.jpg Spoofed folder path -> http://yoursite.com/uploads/2011/09/icon.jpg

My question: Is there anything wrong with the rewrite code that could lead to the error 404 issue?

share|improve this question
up vote 2 down vote accepted

yes, this:

https?://yoursite.com

doesn't do anything you want, just make it http://yoursite.com. Next to that, make sure your server actually supports RedirectMatch.

share|improve this answer
    
Thanks, Joost! I am not even why I had that in there in the first place, but removing it was the solution. – seancojr Oct 7 '11 at 0:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.