![]() |
Quick htaccess question
Something I've never had to do before...
I need to pop up a standard 'no image available' image on a site whenever an image is broken. It has a huge database and manually digging out broken images to replace them would take hours. Any ideas? |
Use HTACCESS:)
|
:upsidedow
|
Quick bump in case anyone knows. Not sure it's even possible though.
|
Quote:
|
There's a way to do it with mod_rewrite. Give me a minute and I'll dig it up for you.
|
http://httpd.apache.org/docs/mod/mod...ml#RewriteCond
-f' (is regular file) Treats the TestString as a pathname and tests if it exists and is a regular file. You will probably find an example of it on this page: http://httpd.apache.org/docs/misc/rewriteguide.html |
Thanks I'll give it a go. If not then yep - looks like a script thing which'll keep me busy while I try to get my head back into php mode - it's been a while :)
|
Fusionx is probably right, but this should work:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.jpg$ /path/to/missing.jpg [L] but be prepared for much more cpu usage |
Quote:
|
Quote:
Scrap the reply above. I replied without thinking or looking at the apache docs. It works more than fine and the CPU usage should be OK as it's a non-porn site so traffic is manageable :) Thanks. |
your fucking sig sucks ass.
|
All times are GMT -7. The time now is 04:22 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123