Jump to content

Image URL Mod Rewrite


CMC

Recommended Posts

 

Hi,

 

I've made an image upload/view script that works nicely but now I'm trying to have the view script generate nice URL's.

i.e: instead of view.php?id=some_id have something like /images/some_id.file_extension (/images/23.gif). The files are stored in a database.

 

Does anyone know if this is possible? I've been looking around and doing a lot of reading but I haven't found anything suggesting if it's possible. I haven't tried either because I am unsure of how to approach the coding aspect. I have basic mod_rewrite knowlede but what is stumping me is how to pass the .gif part. The .gif part will not be used in retrieving the actual image, it's just there to make the URL look nice Also, everything is dynamic; so if the image was a PNG then it would be /images/24.png.

 

Am I making sense?

Link to comment
Share on other sites

  • 4 months later...

I have a very similar question, only the url structure is different.

I would like to request an image of a volcano for example, stored on the server as: img/imagenumber.extension ,via 2 different urls.

 

www.mydomain.com/img/imagenumber/volcano.extension

or

www.mydomain.com/img/volcano.extension?img=imagenumber

 

I can't get a mod write to function for either case, can someone help me?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.