Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Rewrite all images to one?

make money online
Victor Dub Offline referral

Posts: 946
Joined: Oct 2013
Reputation: 5

Posting Freak
How can I show one image for no matter what image name/file you request? In other words I have one image file let's call it default.png.

Now from HTML or where ever you call an image let's say hello.png.

I would like to show default.png image instead of hello.png keeping the URL of hello.png.

Simply replace the content BUT keeping the URL same!
marcus_avrelius Offline referral

Posts: 2,507
Joined: May 2013
Reputation: 109

Support Team
You can use something like this to redirect all images!

Add this to your .htaccess file:

RewriteEngine on
RewriteRule ^images/(.*?)\.png$ image-rewrite.php?id=$1 [L,QSA]

Now create a php file called: image-rewrite.php

Add this code to it:

PHP Code:
$type 'image/jpeg';
header('Content-Length: ' filesize($file));

Now every image that is called like this: images/anything.png will display this image: rewrite-image.jpg.
damponting44 Offline referral

Posts: 536
Joined: Oct 2016
Reputation: 0

Senior Member
This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

Google this topic

User(s) browsing this thread: 1 Guest(s)