Saeid Saeid - 3 months ago 5
Apache Configuration Question

how to redirect a photo url to a new photo address in apache and php

In apache web server i want to make a special url . that each user request for it get its own photo ? how is possible with Url rewriting ?

or if it is possible through php code ?

For example i want a url like this :

http://www.test.com/profileImage.png


when each user request for it get his own profile photo .

user 1 gets

http://www.test.com/user1.png

user 2 gets

http://www.test.com/user2.png

and so on ....

Answer

When a user opens www.test.com/profile-image.php you should internally rewrite that to a PHP script which reads the user id and determines which image to use. You can then simply include it and set the content type to image/png.

Comments