#1
  1. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115

    This works but is it optimal


    Hi guys,

    anyone wants to inspect my code below. It works which is great but maybe i missed something that I may want to add. I included this script in a specific .htaccess file in a specific folder. ( becuase I am not sure how to do it the httpd.conf and limit this rule just for this folder)


    Code:
    RewriteEngine on 
    RewriteRule ^/?([0-9]+)\/checker\.jpg$ script.php?id=$1 [L]
    the idea is to rewrite a link like
    Code:
    12345/checker.jpg
    to

    Code:
    script.php?id=12345
    so again it works, but any improvements/suggestions are more than welcome.
    Thanks for your time in advanced.
    Last edited by aeternus; April 19th, 2012 at 07:48 PM. Reason: spelling
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,127
    Rep Power
    4304
    That's fine the way it is, but if you'd prefer to put the rule in your httpd.conf file, you can use the <location> directive to limit the scope of that rewrite rule.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. For POny!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    Amsterdam
    Posts
    416
    Rep Power
    115
    Great Thanks Kravvitiz!

IMN logo majestic logo threadwatch logo seochat tools logo