Question: ```
RewriteCond %{REQUEST_URI} ^/new/
RewriteRule ^(.*)$ new.php?title=$1 [L,QSA]

```

im confused as to what this does....

what does the REQEUST\_URI do ?

Answer: 
If (`RewriteCond`) the requested URI starts with `/new/`, the script `new.php` is called (`RewriteRule`). It will be passed the requested URI as the `title` parameter, the query string (if any) will be preserved (the `QSA` flag), and no further rules will be processed after this one (the `L` flag).

i.e.

* `http://example.com/new/test.html` would call `http://example.com/new.php?title=/new/test.html`
* `http://example.com/new/test2.html?query=test3` would call `http://example.com/new.php?title=/new/test2.html&query=test3`
*REQEUST\_URI* contains the current [absolute URL path](http://httpd.apache.org/docs/2.2/mod/directive-dict.html#Syntax). So the rule will be applied on every request that’s URL path starts with `/new/…` and rewrites/redirects it internally to the *new.php* file in the current directory (assuming that you didn’t change the base URL path with `RewriteBase`).

So if you use this rule in the .htaccess file of

* your document root directory (`/`), a request of `/new/foo/bar` would be rewritten/redirected to `/new.php?title=new/foo/bar`.
* `/new/` , a request of `/new/foo/bar` would be rewritten/redirected to `/new/new.php?title=foo/bar`.
* `/new/foo`, the request would be rewritten/redirected to `/new/foo/new.php?title=bar`.