0

Is the following situation possible and how:

A user goes to an internet address: www.example.com/image/123.png

File 123.png does not exist - it is created at the moment of entering the address and outputed to the user via imagepng.

Currently I am doing it like www.example.com/image/?link=123.png

I do not have shell access to the server.

Andrius

2 Answers 2

3

If your hosting is using Apache, you can create a file called ".htaccess" in your document root (most often your "public_html" or "www" directory) with something like this (untested):

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^image/(.*)$ image/?link=$1

This is Apache's mod_rewrite functionality.

Sign up to request clarification or add additional context in comments.

Comments

1

you can use url rewriting of your server (I assume you're using apache) to map any URL to your PHP-script. Here's some links for you:

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

http://www.sitepoint.com/guide-url-rewriting/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.