tpl41803 Posted January 27, 2009 Share Posted January 27, 2009 I'm wondering if there's any way to replace the "X" icon that shows up when an image is not found on a webpage with a default image. I'm assuming that if this is possible it would be done in CSS I ran a few google searches and looked around breifly on the forms, but I have no idea what to actually search for, CSS Image Not Found Icon doesn't produce the results im looking for thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 27, 2009 Share Posted January 27, 2009 as far as i know, this can't be done with CSS/HTML, but i think it can be done with htaccess...if someone else knows the rewrite rules off the top of their head, speak up...i'll try to find something in the mean time Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 27, 2009 Share Posted January 27, 2009 in your images folder, create a file called .htaccess (make sure you get that period at the front of the filename) and use this in it: RewriteEngine On # Relative URL to the images folder RewriteBase /images #This assumes it's http://host.com/images/ # Don't change files & folders that exist already RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_FILENAME} !-d [NC] # Show the default if it doesn't exist RewriteRule ^(.+)$ default.jpg # Add a [R] after the filename if you want an actual redirect (instead of a rewrite) Quote Link to comment Share on other sites More sharing options...
reign16 Posted January 28, 2009 Share Posted January 28, 2009 Maybe you can research into the google search for your problem... ___________________ Great thing to know about Busby SEO Test. Quote Link to comment Share on other sites More sharing options...
tpl41803 Posted February 23, 2009 Author Share Posted February 23, 2009 thanks rhodesa, sorry it took so long for me to get back here your code worked perfectly Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 23, 2009 Share Posted February 23, 2009 better late then never glad you got it Quote Link to comment Share on other sites More sharing options...
tpl41803 Posted February 23, 2009 Author Share Posted February 23, 2009 you know... I got it working, but when i tried to log back into my file manager, i get an access denied 403 error-- i removed the code i added and the error went away, so i'm not sure what the problem is that's causing this. my entire .htaccess file looks like this: Options -Indexes ErrorDocument 401 /customerrors/error_401.php ErrorDocument 403 /customerrors/error_403.php ErrorDocument 400 /customerrors/error_400.php ErrorDocument 500 /customerrors/error_500.php ErrorDocument 404 /customerrors/error_404.php RewriteEngine On RewriteBase /image RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteCond %{REQUEST_FILENAME} !-d [NC] RewriteRule ^(.+)$ noimg.jpg when i remove everything from "rewriteEngine..." down i have no problems--I'm just not familiar enough with .htaccess to figure out what the problem code is. thanks :-D Quote Link to comment Share on other sites More sharing options...
rhodesa Posted February 23, 2009 Share Posted February 23, 2009 what is the path (everything after the hostname) for the noimg.jpg file? Quote Link to comment Share on other sites More sharing options...
tpl41803 Posted February 23, 2009 Author Share Posted February 23, 2009 htdocs/image/noimg.jpg and the .htaccess file is located within the htdocs directory Quote Link to comment Share on other sites More sharing options...
tpl41803 Posted February 23, 2009 Author Share Posted February 23, 2009 I figured it out again, hopefully I don't go breaking it-- I just commented out some lines and it worked when I took out the "rewriteengine on" thanks for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.