New Posts  All Forums:Forum Nav:

Mod_rewrite Help!

post #1 of 3
Thread Starter 
I have a php page that spits out a PNG image based on the $_GET U variable.

Here is what a normal url to one of the images looks like:
http://site.com/imagedir/?u=1647576785

I would like it to be accesible via:
http://site.com/imagedir/1647576785.png

with my .htaccess file. Thanks.
post #2 of 3
You need the name of the PHP file in the normal URL for this to work. Just change imagefile to the name of the file, and put this in an .htaccess file in the directory you want it to be used in.

Code:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On

RewriteRule (.*).png imagefile.php?u=$1 [QSA]
I'm not 100% certain it'll work, but it should.
Macbook
(17 items)
 
  
CPUGraphicsRAMHard Drive
Intel P8600 @ 2.4Ghz Geforce 9400M 6GB Crucial DDR3-1066 OCZ Vertex 2 128GB 
Hard DriveOptical DriveOSOS
External 1TB Broken and Making Funny Noises OS X Lion Windows 8 Preview 
MonitorMonitorKeyboardPower
13.3" 1280x800 Dell 2407WFP-HC Backlit Lithium-Polymer Battery 
CaseMouseAudio
Unibody Multi-Touch Trackpad JVC Marshmallow's 
  hide details  
Reply
Macbook
(17 items)
 
  
CPUGraphicsRAMHard Drive
Intel P8600 @ 2.4Ghz Geforce 9400M 6GB Crucial DDR3-1066 OCZ Vertex 2 128GB 
Hard DriveOptical DriveOSOS
External 1TB Broken and Making Funny Noises OS X Lion Windows 8 Preview 
MonitorMonitorKeyboardPower
13.3" 1280x800 Dell 2407WFP-HC Backlit Lithium-Polymer Battery 
CaseMouseAudio
Unibody Multi-Touch Trackpad JVC Marshmallow's 
  hide details  
Reply
post #3 of 3
Thread Starter 
The $_GET variable isn't passed :/
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming