Mod rewrite for a dynamic image

Discussion in 'Apache' started by Durinthiam, Nov 5, 2006.

  1. #1
    Currently making a dynamic image that people can use to display their names on BF2142 dogtags


    i have the rewrite working to replace index.php?name=NAMEHERE so that it shows the image
    http://www.ultimatestrikeforce.co.uk/dogtags/Durinthiam.png

    however when someone tries to use a non standard like - = + @ it removes all characters before it

    http://www.ultimatestrikeforce.co.uk/dogtags/NCC-1709.png

    is there any way to stop this? tried scouring google and my regular forums but no joy so far

    My .htaccess
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ([A-Za-z0-9]+)\.png$ index.php?player=$1 [NC]
    
    Code (markup):
     
    Durinthiam, Nov 5, 2006 IP
  2. WhiteHatHacker

    WhiteHatHacker Peon

    Messages:
    21
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You mean ultimatestrikeforce.co.uk/dogtags/NCC-1709.png produces a dogtag image with just "1709" on it? Strange.

    Anyway, I should imagine this fits the bill:
    RewriteRule ([A-Za-z0-9\+@=_-]+)\.png$ index.php?player=$1 [NC]
    Code (markup):
    instead of the rewrite rule you currently have. Try escaping (backslash before) different characters, and/or adding them there.
     
    WhiteHatHacker, Nov 8, 2006 IP