PHP string to image

Using mod_rewrite to handle various content issues

PHP string to image

Postby Fez » Thu Sep 18, 2008 12:01 pm

hey, i was wondering
if i had a file
and I wanted to turn it into
Where username is a variable and changes depending on what the user input so if someone requests its actually being taken from and being rewritten
how would I do that?

thanks in advance
Posts: 1
Joined: Thu Sep 18, 2008 11:50 am

Postby richardk » Fri Sep 19, 2008 6:51 am

Yes, try the following in a .htaccess file in your doucment root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^image/([^/]+)\.png$ /script/image.php?username=$1 [QSA,L]
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Content

Who is online

Users browsing this forum: No registered users and 1 guest