I’m trying to use htaccess redirect to a file, but can’t get the image to display.
I want to redirect ANY request to mydomain.com or http://www.mydomain.com to http://www.mydomain.com/test.html
This is the content of my htaccess file:
# Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/test.html
RewriteCond %{REQUEST_URI} !=*\.png$ [NC]
RewriteRule .* /test.html
I have this line of code in my test.html file:
<img src="image.png" alt="My Image">
But the image doesn’t display at all, I just get a broken image. I also tried using absolute path for image, same thing.
Try replacing your .htaccess file with the following