Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

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.