Looking for help with 2-tier clean URL's using .htaccess -
i working on site have 2 levels url reaches
my objective have clean url's this...
http://domain.com/username/dosomething
my ugly url's this...
http://domain.com/index.php?page=username&command=dosomething
my attempt this
rewriteengine on rewriterule ^([a-za-z0-9]+)$ index.php?page=$1&command=$2 rewriterule ^([a-za-z0-9]+)/$1/$2 index.php?page=$1&command=$2
you're not using backreferences correctly in first part. backreferences parenthesised expressions filled $1, $2 et al. in second part of rule. e.g.:
rewriterule ^([^/]+)/([^/]+)$ /index.php?page=$1&command=$2
these parenthesized expressions match 1 or more non-/ characters , fill them $1 , $2 respectively.
Comments
Post a Comment