rewriting php links to static links

Discussion in 'Apache' started by Scriptona, Feb 25, 2008.

  1. #1
    Hello

    How to redirect all (not only for single file. but all files linked to the file.php page)

    www.site.com/file.php?filename=gg709219.jpg
    Code (markup):
    to be

    www.site.com/file/gg709219
    Code (markup):
     
    Scriptona, Feb 25, 2008 IP
  2. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Options +FollowSymlinks
    RewriteEngine On
    
    RewriteRule ^/file/(.*)$ /file.php?filename=$1.jpg [L]
    Code (markup):
    Not sure but I think it will do the job.
     
    kulinar, Feb 26, 2008 IP