mod_rewrite help

Discussion in 'Apache' started by markph, Mar 22, 2011.

  1. #1
    Hi, I need help with my mod_rewrite for a site im currently working on.

    Lets say I have this site http://example.com

    And I want to be able to make any value after the / to route to page.php like below

    http://example.com/value1
    http://example.com/value2

    to point to

    http://example.com/page.php?id=value1
    http://example.com/page.php?id=value2

    But not route to that page when im pointing to "admin"

    http://example.com/admin

    I've tried

    RewriteEngine on
    RewriteCond $1 !^(admin)
    RewriteRule ^(.*)$ /page.php?id=$1 [L]

    But it isn't working. Any thoughts?
     
    markph, Mar 22, 2011 IP