FFY00
FFY00

Reputation: 102

Spoof .php as .png in .htaccess?

I created a dynamic image script in PHP but I want to show it as .png.

What is the .htaccess configuration to type domain.com/image/image.png and return the content of domain.com/image/image.php?

Upvotes: 0

Views: 370

Answers (1)

Ultimater
Ultimater

Reputation: 4738

Assuming your .htaccess file is placed at your web root, give this a try:

RewriteEngine On
RewriteRule ^image/image\.png image/image.php [L]

Alternatively, you can name a directory "image.png" then place an index.php file in there thus: image/image.png/index.php.

Upvotes: 1

Related Questions