How to make a URL ending in .JPG as actual page?

Discussion in 'Programming' started by amedia, Feb 10, 2011.

  1. #1
    amedia, Feb 10, 2011 IP
  2. clonepal

    clonepal Active Member

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #2
    You need to write a mod_rewrite code in your .htaccess file from your server.

    If you don't have one on your server, just open a new notepad file and save it with the name: .htaccess

    Then save it to your desktop and upload it to your server.

    Tell me where you want to add the .png extension so i can give you the code for .htaccess file.

    -Alex
     
    clonepal, Feb 10, 2011 IP
  3. amedia

    amedia Well-Known Member

    Messages:
    819
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Hi Alexa,

    Could you show me a sample with a fake URL?

    Thanks
     
    amedia, Feb 10, 2011 IP
  4. Simple Link Media

    Simple Link Media Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    RewriteRule ^image/([a-zA-Z0-9_-]+).(jpg|jpeg|png|gif|bmp)$ image.php?image=$1.$2
    Code (markup):
    Just an example to show you what clonepal was talking about. You might want to tweak it before going live ..
     
    Simple Link Media, Feb 10, 2011 IP
  5. clonepal

    clonepal Active Member

    Messages:
    128
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #5
    Also try this:
    
    RewriteRule ^images/([0-9]+)\.(gif|jpg|png)$ view.php?id=$1 [L]
    
    Code (markup):
    -Alex
     
    clonepal, Feb 10, 2011 IP
  6. DmitryS

    DmitryS Active Member

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    here is potential solution

    go to iss settings your virtual directory properties
    add a extension as *.jpg make it run through asp.net dll
     
    DmitryS, Feb 11, 2011 IP