How do I override htaccess for specific files?

I have a wordpress site configured in multiuser mode for hosting client sites. One client has a javascript calendar widget that gets imported from auctionzip.com. The calendar is working fine, but there are two missing graphics. I know the path to the graphics that is being searched, but when I place folders and files on my site that corresponds to the path, I get a 404 error.

I believe the .htaccess file is rewriting the path. I would like to know where I need to place the files, or how I can override .htacess for just the specific files I need.

The javascript widget is looking for files at myserver.com/files/Image/filename.gif When I create this on my server, I can see myserver.com/files but when I try to load myserver.com/files/Image I get a 404 error.

I believe this is the offending line of code in .htaccess. I would like to understand what this line of code is doing, and how I can either bypass it for specific files, or otherwise place local copies of the required .gif files on my server in a path that the javascript can reference. I cannot change the javascript, only the files on my server.

RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]


Here is the entire .htaccess file contents

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
Tim-SocialLifeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
You have two options:

1) Modify the .htaccess file to exempt the specific files from the RewriteRule.  I do not recommend this since it requires manual management of the file list.
2) Examine ms-files.php to find out how it parses the path, then place the files where the script will expect to find them.
0
Tim-SocialLifeAuthor Commented:
How would I modify the .htaccess file to except the specific files from the RewriteRule? In this case, the files need to be located at myserver.com/files/Image/filename.gif

0
Steve BinkCommented:
To exempt a single file:

RewriteCond %{REQUEST_URI} !/?files/Image/filename.gif$
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

Open in new window


To exempt existing files:

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tim-SocialLifeAuthor Commented:
Thank you, this is exactly what I needed to know.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.