htaccess variables from url

Discussion in 'Apache' started by kegster, Feb 18, 2011.

  1. #1
    Hello,

    If you view www.domain.com/directory/slug,
    how do i get 'slug' inside a variable for use within a rewrite? i'm using mapping to use SQL to pull another field from a table.

    Does this make sense?
     
    kegster, Feb 18, 2011 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Try this one
    RewriteEngine On
    RewriteRule ^directory/(*.)$ yourfile.php?var=$1
    Code (markup):
     
    mwasif, Feb 18, 2011 IP