Apache rewrites screwing up images
I have an Apache proxy config with a ton of rewrites to other servers, so in order to handle the "trailing slash problem" in one place, I had added this to the beginning of a virtual host file:
Code:
Options +FollowSymlinks Code:
RewriteRule ^/somesite/(.*)$ http://some.server.com/somesite/somelongpath/$1 [R=301,NC,L] One thing I should mention is that this config is running on an old Apache version (1.3), so there may be some differences in config from the versions I'm more accustomed to (v2.x+), even though httpd doesn't complain at all on syntax checks or restarts. Is there a cross-version way to do this? Or maybe just a way that works in v1.3? |
You should probably convert it to a rewrite condition for the trailing slash rule rather than it being a rewrite rule by itself
cheers |
Quote:
|
Sorry.. I wasn't reading carefully enough, apache rewrites are really easy to get wrong.
I usually turn on rewrite logging when troubleshooting : Code:
RewriteEngine On Code:
... |
Thanks kbp, but no, moving the rules doesn't seem to help ... it may be because I have so many other redirects going on, but moving the slash rule isn't working ...
Here's an example log entry for one image file that shows a redirect for the image file ... but I don't see an error in the entry itself, but the actual HTML renders with missing images (which still show references to "image.gif/"): http://deesto.pastebin.com/m612bb3a8 ... and here is the current config; maybe you'll see a mistake that I haven't noticed: http://deesto.pastebin.com/m30951176 |
The image listed in the log didn't get modified because it matched one of the previous rules, the 'trailing slash' rule will only affect requests that don't match any of the previous rules. Could you please provide an example url with the broken image links ?
thnx |
Thanks kbp ... sent you a PM with some URLs ... let me know if you can see where I'm screwing up?
|
Just wanted to make a quick mention that although we weren't able to pinpoint the problem with these Apache directives (bloody rewrite rules!), kbp was kind enough to get in touch with me privately and try to analyze the conf files, log data, etc. I really appreciate his help.
|
All times are GMT -5. The time now is 09:11 AM. |