In what way do you mean rewrite? you are not likely to get a proper answer unless you better explain what it is you are attempting to do.
I mean if my site is dynamic and want to optimize than the urls of the site are dynamice so how can i rewrite those urls as i heard if i want to optimize dynamic site than i have to rewrite urls....