Code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule bin/(.*)/(.*)/(.*)$ /folderinroot/$3?id=$1&user=$2
I used it so href="bin/value1/value2/page.php" was a valid link. page.php must exist where you specified in your .htaccess file. change or delete 'folderinroot/'
The first instance of $ is end match string. Match string starts at 'bin/'.
The symbol $ denotes start and the numeral specifies which group of brackets of the rewritten url.
The leftmost group is $1. The (.*) sequence means match any charactor, there are other ways to more selectively choose which charactors to match. Any charactor that appears outside of of the bracket is a literal match.
You also might notice that you need to use
PHP Code:
$url=$_SERVER['REQUEST_URI'] followed by explode("/",$url)
"SELECT * FROM * WHERE id=$url(1) AND user=$url(2)"
RewriteRule /(.*) (.*)/$ /$1_$2/
If mod-rewrite is capable of 'matching' a blank space that would replace it with a '_'
__________________
Check out my Please login or register to view this content. Registration is FREE website!
|